- 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:
parent
aee102d05d
commit
35ae7f4eae
|
@ -135,7 +135,8 @@ DynamicProcess::get_state() const
|
||||||
void
|
void
|
||||||
DynamicProcess::serialize(SerializeVisitor& translator) const
|
DynamicProcess::serialize(SerializeVisitor& translator) const
|
||||||
{
|
{
|
||||||
translator.from_process(*_core);
|
// translator.from_process(*_core);
|
||||||
|
translator.from_process(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
StaticProcess&
|
StaticProcess&
|
||||||
|
|
|
@ -102,7 +102,8 @@ DynamicThread::get_requests()
|
||||||
void
|
void
|
||||||
DynamicThread::serialize(SerializeVisitor& translator) const
|
DynamicThread::serialize(SerializeVisitor& translator) const
|
||||||
{
|
{
|
||||||
translator.from_thread(*_core);
|
//translator.from_thread(*_core);
|
||||||
|
translator.from_thread(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
StaticThread&
|
StaticThread&
|
||||||
|
|
|
@ -23,9 +23,11 @@
|
||||||
|
|
||||||
namespace sgpem
|
namespace sgpem
|
||||||
{
|
{
|
||||||
|
class History;
|
||||||
|
class Environment;
|
||||||
class Resource;
|
class Resource;
|
||||||
class StaticProcess;
|
class Process;
|
||||||
class StaticThread;
|
class Thread;
|
||||||
class Request;
|
class Request;
|
||||||
class SubRequest;
|
class SubRequest;
|
||||||
}
|
}
|
||||||
|
@ -38,15 +40,58 @@ namespace sgpem
|
||||||
{
|
{
|
||||||
class SerializeVisitor;
|
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
|
class SerializeVisitor
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual ~SerializeVisitor() = 0;
|
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_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;
|
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;
|
virtual void from_subrequest(const SubRequest& obj) = 0;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue