//## begin module.cm preserve=no // %X% %Q% %Z% %W% //## end module.cm //## begin module.cp preserve=no //## end module.cp //## Module: PStream; Pseudo Package body //## Subsystem: Figures //## Source file: PStream.cpp //## begin module.additionalIncludes preserve=no //## end module.additionalIncludes //## begin module.includes preserve=yes //## end module.includes // PStream #include "PStream.h" //## begin module.additionalDeclarations preserve=yes #include "prsstent.h" //## end module.additionalDeclarations // Class PStream PStream::PStream() //## begin PStream::PStream%.hasinit preserve=no : saving(false) //## end PStream::PStream%.hasinit //## begin PStream::PStream%.initialization preserve=yes //## end PStream::PStream%.initialization { //## begin PStream::PStream%.body preserve=yes for(int i=0 ; iname() << endl; x->archive(*this); } } // Let's load some data else{ int n; (*this) >> n; if(n==0){ x=0; return; } x = find(n); if(x == 0) { Str name; (*this) >> name; x = Persistent::clone1(name.getStr()); if(x==0){ clear(ios::failbit); return; } add(n, x); x->archive(*this); } } //## end PStream::archive%940866986.body } Persistent* PStream::find (int x) const { //## begin PStream::find%940866987.body preserve=yes if(x>=0 && xexist((Persistent*)p)) return tmp->find((Persistent*) p); return 0; //## end PStream::find%940866989.body } int PStream::add (const Persistent* data) { //## begin PStream::add%940866990.body preserve=yes int size=psMap.getSize()+1; PsMap* tmp = (PsMap*)&psMap; tmp->add((Persistent*)data, size); return size; //## end PStream::add%940866990.body } // Additional Declarations //## begin PStream.declarations preserve=yes //## end PStream.declarations //## begin module.epilog preserve=yes //## end module.epilog