117 lines
2.9 KiB
C++
117 lines
2.9 KiB
C++
//## begin module.cm preserve=no
|
|
|
|
// %X% %Q% %Z% %W%
|
|
|
|
//## end module.cm
|
|
|
|
|
|
|
|
//## begin module.cp preserve=no
|
|
|
|
//## end module.cp
|
|
|
|
|
|
|
|
//## Module: Persistent; Pseudo Package specification
|
|
|
|
//## Subsystem: Figures
|
|
|
|
//## Source file: Prsstent.h
|
|
|
|
|
|
|
|
#ifndef Prsstent_h
|
|
|
|
#define Prsstent_h 1
|
|
|
|
|
|
|
|
//## begin module.additionalIncludes preserve=no
|
|
|
|
//## end module.additionalIncludes
|
|
|
|
|
|
|
|
//## begin module.includes preserve=yes
|
|
|
|
//## end module.includes
|
|
|
|
|
|
|
|
// InstMap
|
|
|
|
#include "InstMap.h"
|
|
|
|
// PStream
|
|
|
|
//#include "PStream.h"
|
|
|
|
//## begin module.additionalDeclarations preserve=yes
|
|
|
|
class PStream;
|
|
|
|
|
|
|
|
#define DECLARE_PERSISTENT(X) \
|
|
|
|
char* name() const {return #X;} \
|
|
|
|
Persistent* clone() const {return new X(*this);} \
|
|
|
|
static Persistent* _pobj;
|
|
|
|
|
|
|
|
#define IMPLEMENT_PERSISTENT(X) \
|
|
|
|
Persistent* X::_pobj = Persistent::addType(#X, new X);
|
|
|
|
|
|
|
|
|
|
|
|
//## end module.additionalDeclarations
|
|
|
|
|
|
|
|
|
|
|
|
//## Class: Persistent
|
|
|
|
//## Category: Persist
|
|
|
|
//## Subsystem: Figures
|
|
|
|
//## Persistence: Transient
|
|
|
|
//## Cardinality/Multiplicity: n
|
|
|
|
|
|
|
|
//## Uses: <unnamed>; PStream { -> }
|
|
|
|
|
|
|
|
class Persistent
|
|
|
|
{
|
|
|
|
//## begin Persistent.initialDeclarations preserve=yes
|
|
|
|
//## end Persistent.initialDeclarations
|
|
|
|
|
|
|
|
public:
|
|
|
|
//## Constructors (generated)
|
|
|
|
Persistent();
|
|
|
|
|
|
|
|
//## Destructor (generated)
|
|
|
|
~Persistent();
|
|
|
|
|
|
|
|
|
|
|
|
//## Other Operations (specified)
|
|
|
|
//## Operation: archive%940866976
|
|
|
|
virtual void archive (PStream& ps) = 0;
|
|
|
|
|
|
|
|
//## Operation: name%940866977
|
|
|
|
virtual char* name () const = 0;
|
|
|
|
|
|
|
|
//## Operation: clone%940866978
|
|
|
|
virtual Persistent* clone1 () const = 0;
|
|
|
|
|
|
|
|
//## Operation: addType%940866979
|
|
|
|
static Persistent* addType (char* name, Persistent* pers);
|
|
|
|
|
|
|
|
//## Operation: clone%940866991
|
|
|
|
static Persistent* clone1 (char* name);
|
|
|
|
|
|
|
|
// Additional Public Declarations
|
|
|
|
//## begin Persistent.public preserve=yes
|
|
|
|
//## end Persistent.public
|
|
|
|
|
|
|
|
protected:
|
|
|
|
// Additional Protected Declarations
|
|
|
|
//## begin Persistent.protected preserve=yes
|
|
|
|
//## end Persistent.protected
|
|
|
|
|
|
|
|
private:
|
|
|
|
// Additional Private Declarations
|
|
|
|
//## begin Persistent.private preserve=yes
|
|
|
|
//## end Persistent.private
|
|
|
|
|
|
|
|
private: //## implementation
|
|
|
|
// Data Members for Has Relationships
|
|
|
|
|
|
|
|
//## Documentation Persistent::instMap.has
|
|
|
|
//## begin Persistent::instMap.has preserve=no private: static InstMap {1 -> 1VO}
|
|
|
|
static InstMap instMap;
|
|
|
|
//## end Persistent::instMap.has
|
|
|
|
|
|
|
|
// Additional Implementation Declarations
|
|
|
|
//## begin Persistent.implementation preserve=yes
|
|
|
|
//## end Persistent.implementation
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
//## begin Persistent.postscript preserve=yes
|
|
|
|
//## end Persistent.postscript
|
|
|
|
|
|
|
|
// Class Persistent
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//## begin module.epilog preserve=yes
|
|
|
|
//## end module.epilog
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|