81 lines
2.0 KiB
C++
81 lines
2.0 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 body
|
|
|
|
//## Subsystem: Figures
|
|
|
|
//## Source file: Prsstent.cpp
|
|
|
|
|
|
|
|
//## begin module.additionalIncludes preserve=no
|
|
|
|
//## end module.additionalIncludes
|
|
|
|
|
|
|
|
//## begin module.includes preserve=yes
|
|
|
|
//## end module.includes
|
|
|
|
|
|
|
|
// Persistent
|
|
|
|
#include "Prsstent.h"
|
|
|
|
//## begin module.additionalDeclarations preserve=yes
|
|
|
|
//## end module.additionalDeclarations
|
|
|
|
|
|
|
|
|
|
|
|
// Class Persistent
|
|
|
|
|
|
|
|
//## begin Persistent::instMap.has preserve=no private: static InstMap {1 -> 1VO}
|
|
|
|
InstMap Persistent::instMap;
|
|
|
|
//## end Persistent::instMap.has
|
|
|
|
|
|
|
|
Persistent::Persistent()
|
|
|
|
//## begin Persistent::Persistent%.hasinit preserve=no
|
|
|
|
//## end Persistent::Persistent%.hasinit
|
|
|
|
//## begin Persistent::Persistent%.initialization preserve=yes
|
|
|
|
//## end Persistent::Persistent%.initialization
|
|
|
|
{
|
|
|
|
//## begin Persistent::Persistent%.body preserve=yes
|
|
|
|
//## end Persistent::Persistent%.body
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Persistent::~Persistent()
|
|
|
|
{
|
|
|
|
//## begin Persistent::~Persistent%.body preserve=yes
|
|
|
|
//## end Persistent::~Persistent%.body
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//## Other Operations (implementation)
|
|
|
|
Persistent* Persistent::addType (char* name, Persistent* pers)
|
|
|
|
{
|
|
|
|
//## begin Persistent::addType%940866979.body preserve=yes
|
|
|
|
Str tmp(name);
|
|
|
|
// if(!instMap)
|
|
|
|
// {
|
|
|
|
// instMap = new InstMap;
|
|
|
|
// }
|
|
|
|
instMap.add(tmp, pers);
|
|
|
|
return pers;
|
|
|
|
//## end Persistent::addType%940866979.body
|
|
|
|
}
|
|
|
|
|
|
|
|
Persistent* Persistent::clone1 (char* name)
|
|
|
|
{
|
|
|
|
//## begin Persistent::clone%940866991.body preserve=yes
|
|
|
|
Persistent *p;
|
|
|
|
Str tmp(name);
|
|
|
|
p=instMap.find(tmp);
|
|
|
|
return p->clone1();
|
|
|
|
//## end Persistent::clone%940866991.body
|
|
|
|
}
|
|
|
|
|
|
|
|
// Additional Declarations
|
|
|
|
//## begin Persistent.declarations preserve=yes
|
|
|
|
//## end Persistent.declarations
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//## begin module.epilog preserve=yes
|
|
|
|
//## end module.epilog
|
|
|