- Added other two dialogs for the gui

- Added exception specifications to the methods of the serializer interface and xml plugin

git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@821 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
elvez 2006-08-04 00:29:37 +00:00
parent 56d7ddbc5a
commit 974702af3e
10 changed files with 678 additions and 48 deletions

View file

@ -40,7 +40,7 @@ XMLSerializer::XMLSerializer()
void XMLSerializer::save_snapshot(const Glib::ustring& filename, const History& hist)
void XMLSerializer::save_snapshot(const Glib::ustring& filename, const History& hist) throw(SerializeError)
{
/* COMPAT: Do not genrate nodes for formatting spaces */
LIBXML_TEST_VERSION
@ -65,7 +65,7 @@ void XMLSerializer::save_snapshot(const Glib::ustring& filename, const History&
xmlCleanupParser();
}
void XMLSerializer::restore_snapshot(const Glib::ustring& filename, History& hist)
void XMLSerializer::restore_snapshot(const Glib::ustring& filename, History& hist) throw(SerializeError)
{
// TODO - all to do!!
// DEBUG - remove me when finished
@ -222,7 +222,7 @@ void XMLSerializer::clear_history(History& hist)
}
void XMLSerializer::read_doc(xmlDocPtr doc, XMLSerializerFactory& fact)
void XMLSerializer::read_doc(xmlDocPtr doc, XMLSerializerFactory& fact) throw(SerializeError)
{
/*
* Check the document is of the right kind

View file

@ -61,7 +61,7 @@ namespace sgpem
\throws backend::SerializerError on error
*/
virtual void save_snapshot(const Glib::ustring& filename, const History& hist);
virtual void save_snapshot(const Glib::ustring& filename, const History& hist) throw(SerializeError);
/**
\brief Re-initialize system status from a saved XML snapshot
@ -72,7 +72,7 @@ namespace sgpem
\throws backend::SerializerError
*/
virtual void restore_snapshot(const Glib::ustring& filename, History& hist);
virtual void restore_snapshot(const Glib::ustring& filename, History& hist) throw(SerializeError);
/**
\return Constant string "xsgp"
@ -124,7 +124,7 @@ namespace sgpem
Traverse the passed (previously readed) xml document and
rebuild the correct image using the XMLSerializerFactory object.
*/
void read_doc(xmlDocPtr doc, XMLSerializerFactory& fact);
void read_doc(xmlDocPtr doc, XMLSerializerFactory& fact) throw(SerializeError);
/**
\brief Restore all the resources from the passed xml node

View file

@ -50,7 +50,7 @@ History* XMLSerializerFactory::get_history()
}
void
XMLSerializerFactory::factory_method(const Glib::ustring& class_name, Parameters& parameters)
XMLSerializerFactory::factory_method(const Glib::ustring& class_name, Parameters& parameters) throw(SerializeError)
{
if(class_name == "Resource")
{

View file

@ -76,7 +76,7 @@ namespace sgpem
\throw SerializerError If not all necessary parameters for an object creation are provided
*/
void factory_method(const Glib::ustring& class_name, Parameters& parameters);
void factory_method(const Glib::ustring& class_name, Parameters& parameters) throw(SerializeError);
protected:
private:
typedef Environment::resource_key_t resource_key_t;

View file

@ -44,7 +44,7 @@ XMLVisitor::~XMLVisitor()
{
}
void XMLVisitor::from_resource(const Resource& obj)
void XMLVisitor::from_resource(const Resource& obj) throw(SerializerError)
{
throw SerializerError(
_("XMLVisitor: unsupported method from_resource(const Resource& obj)")
@ -52,42 +52,42 @@ void XMLVisitor::from_resource(const Resource& obj)
}
void XMLVisitor::from_history(const History& obj)
void XMLVisitor::from_history(const History& obj) throw(SerializerError)
{
from_history(_current, obj);
}
void XMLVisitor::from_environment(const Environment& obj)
void XMLVisitor::from_environment(const Environment& obj) throw(SerializerError)
{
from_environment(_current, obj);
}
void XMLVisitor::from_process(const Process& obj)
void XMLVisitor::from_process(const Process& obj) throw(SerializerError)
{
from_process(_current, obj);
}
void XMLVisitor::from_thread(const Thread& obj)
void XMLVisitor::from_thread(const Thread& obj) throw(SerializerError)
{
from_thread(_current, obj);
}
void XMLVisitor::from_request(const Request& obj)
void XMLVisitor::from_request(const Request& obj) throw(SerializerError)
{
from_request(_current, obj);
}
void XMLVisitor::from_subrequest(const SubRequest& obj)
void XMLVisitor::from_subrequest(const SubRequest& obj) throw(SerializerError)
{
from_subrequest(_current, obj);
}
void XMLVisitor::from_resource(const Resource& obj, const Glib::ustring& key)
void XMLVisitor::from_resource(const Resource& obj, const Glib::ustring& key) throw(SerializerError)
{
from_resource(_current, obj, key);
}
@ -98,7 +98,7 @@ void XMLVisitor::from_resource(const Resource& obj, const Glib::ustring& key)
void XMLVisitor::from_history(xmlNodePtr parent, const History& hist)
void XMLVisitor::from_history(xmlNodePtr parent, const History& hist) throw(SerializerError)
{
if(parent!=NULL)
{
@ -111,7 +111,7 @@ void XMLVisitor::from_history(xmlNodePtr parent, const History& hist)
}
void XMLVisitor::from_environment(xmlNodePtr parent, const Environment& env)
void XMLVisitor::from_environment(xmlNodePtr parent, const Environment& env) throw(SerializerError)
{
if(parent==NULL)
{
@ -158,7 +158,7 @@ void XMLVisitor::from_environment(xmlNodePtr parent, const Environment& env)
}
void XMLVisitor::from_resource(xmlNodePtr parent, const Resource& obj, const Glib::ustring& key)
void XMLVisitor::from_resource(xmlNodePtr parent, const Resource& obj, const Glib::ustring& key) throw(SerializerError)
{
if(parent!=NULL)
{
@ -182,7 +182,7 @@ void XMLVisitor::from_resource(xmlNodePtr parent, const Resource& obj, const Gli
}
void XMLVisitor::from_process(xmlNodePtr parent, const Process& obj)
void XMLVisitor::from_process(xmlNodePtr parent, const Process& obj) throw(SerializerError)
{
if(parent!=NULL)
{
@ -220,7 +220,7 @@ void XMLVisitor::from_process(xmlNodePtr parent, const Process& obj)
}
void XMLVisitor::from_thread(xmlNodePtr parent, const Thread& obj)
void XMLVisitor::from_thread(xmlNodePtr parent, const Thread& obj) throw(SerializerError)
{
if(parent!=NULL)
{
@ -261,7 +261,7 @@ void XMLVisitor::from_thread(xmlNodePtr parent, const Thread& obj)
}
void XMLVisitor::from_request(xmlNodePtr parent, const Request& obj)
void XMLVisitor::from_request(xmlNodePtr parent, const Request& obj) throw(SerializerError)
{
if(parent!=NULL)
{
@ -294,7 +294,7 @@ void XMLVisitor::from_request(xmlNodePtr parent, const Request& obj)
}
void XMLVisitor::from_subrequest(xmlNodePtr parent, const SubRequest& obj)
void XMLVisitor::from_subrequest(xmlNodePtr parent, const SubRequest& obj) throw(SerializerError)
{
if(parent!=NULL)
{

View file

@ -69,61 +69,61 @@ namespace sgpem
\brief Add output to the serializer taking data from history
Wrapper method: call from_history(xmlNodePtr parent, const History& obj);
*/
virtual void from_history(const History& obj);
virtual void from_history(const History& obj) throw(SerializerError);
/**
\brief Add output to the serializer taking data from environment
Wrapper method: call from_environment(xmlNodePtr parent, const Environment& obj);
*/
virtual void from_environment(const Environment& obj);
virtual void from_environment(const Environment& obj) throw(SerializerError);
/**
\brief Add output to the serializer taking data from resource
BUG: a resource must be saved with her own associated key.
Throw an exception.
*/
virtual void from_resource(const Resource& obj);
virtual void from_resource(const Resource& obj) throw(SerializerError);
/**
\brief Add output to the serializer taking data from resource and key
BUG FIXED: This save a resource with her own associated key.
Wrapper method: call from_resource(xmlNodePtr parent, const Resource& obj, const Glib::ustring& key);
*/
virtual void from_resource(const Resource& obj, const Glib::ustring& key);
virtual void from_resource(const Resource& obj, const Glib::ustring& key) throw(SerializerError);
/**
\brief Add output to the serializer taking data from process
Wrapper method: call from_process(xmlNodePtr parent, const Process& obj);
*/
virtual void from_process(const Process& obj);
virtual void from_process(const Process& obj) throw(SerializerError);
/**
\brief Add output to the serializer taking data from thread
Wrapper method: call from_thread(xmlNodePtr parent, const Thread& obj);
*/
virtual void from_thread(const Thread& obj);
virtual void from_thread(const Thread& obj) throw(SerializerError);
/**
\brief Add output to the serializer taking data from request
Wrapper method: call from_request(xmlNodePtr parent, const Request& obj);
*/
virtual void from_request(const Request& obj);
virtual void from_request(const Request& obj) throw(SerializerError);
/**
\brief Add output to the serializer taking data from subrequest
Wrapper method: call from_subrequest(xmlNodePtr parent, const SubRequest& obj);
*/
virtual void from_subrequest(const SubRequest& obj);
virtual void from_subrequest(const SubRequest& obj) throw(SerializerError);
private:
void from_history(xmlNodePtr parent, const History& obj);
void from_environment(xmlNodePtr parent, const Environment& obj);
void from_resource(xmlNodePtr parent, const Resource& obj, const Glib::ustring& key);
void from_process(xmlNodePtr parent, const Process& obj);
void from_thread(xmlNodePtr parent, const Thread& obj);
void from_request(xmlNodePtr parent, const Request& obj);
void from_subrequest(xmlNodePtr parent, const SubRequest& obj);
void from_history(xmlNodePtr parent, const History& obj) throw(SerializerError);
void from_environment(xmlNodePtr parent, const Environment& obj) throw(SerializerError);
void from_resource(xmlNodePtr parent, const Resource& obj, const Glib::ustring& key) throw(SerializerError);
void from_process(xmlNodePtr parent, const Process& obj) throw(SerializerError);
void from_thread(xmlNodePtr parent, const Thread& obj) throw(SerializerError);
void from_request(xmlNodePtr parent, const Request& obj) throw(SerializerError);
void from_subrequest(xmlNodePtr parent, const SubRequest& obj) throw(SerializerError);
xmlNodePtr _current;
};