- updated seriralize_visitor to manage history & environment

- corrected wrong calls to SerializeVisitor in dynamic_process & dynamic_thread



git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@763 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
paolo 2006-07-15 01:25:31 +00:00
parent aee102d05d
commit 35ae7f4eae
3 changed files with 53 additions and 6 deletions

View File

@ -135,7 +135,8 @@ DynamicProcess::get_state() const
void
DynamicProcess::serialize(SerializeVisitor& translator) const
{
translator.from_process(*_core);
// translator.from_process(*_core);
translator.from_process(*this);
}
StaticProcess&

View File

@ -102,7 +102,8 @@ DynamicThread::get_requests()
void
DynamicThread::serialize(SerializeVisitor& translator) const
{
translator.from_thread(*_core);
//translator.from_thread(*_core);
translator.from_thread(*this);
}
StaticThread&

View File

@ -23,9 +23,11 @@
namespace sgpem
{
class History;
class Environment;
class Resource;
class StaticProcess;
class StaticThread;
class Process;
class Thread;
class Request;
class SubRequest;
}
@ -38,15 +40,58 @@ namespace sgpem
{
class SerializeVisitor;
/**
\brief Interface class to serialize data
This class is a virtual class and each method must be reimplemented
in derived classes to have effective serialization.
*/
class SerializeVisitor
{
public:
virtual ~SerializeVisitor() = 0;
/**
\brief Add output to the serializer taking data from history
*/
virtual void from_history(const History& obj) = 0;
/**
\brief Add output to the serializer taking data from environment
*/
virtual void from_environment(const Environment& obj) = 0;
/**
\brief Add output to the serializer taking data from resource
BUG: a resource must be saved with her own associated key.
*/
virtual void from_resource(const Resource& obj) = 0;
virtual void from_process(const StaticProcess& obj) = 0;
virtual void from_thread(const StaticThread& obj) = 0;
/**
\brief Add output to the serializer taking data from resource and key
BUG FIXED: This save a resource with her own associated key.
*/
virtual void from_resource(const Resource& obj, const Glib::ustring& key) = 0;
/**
\brief Add output to the serializer taking data from process
*/
virtual void from_process(const Process& obj) = 0;
/**
\brief Add output to the serializer taking data from thread
*/
virtual void from_thread(const Thread& obj) = 0;
/**
\brief Add output to the serializer taking data from request
*/
virtual void from_request(const Request& obj) = 0;
/**
\brief Add output to the serializer taking data from subrequest
*/
virtual void from_subrequest(const SubRequest& obj) = 0;
};
}