Changeset 4051 in Sophya
- Timestamp:
- Feb 25, 2012, 10:40:10 PM (12 years ago)
- Location:
- trunk/SophyaLib/BaseTools
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/BaseTools/basetools.h
r3612 r4051 22 22 #include "srandgen.h" 23 23 #include "datatype.h" 24 #include "ppfwrapstlv.h" 24 25 #include "randr48.h" 25 26 #include "randfmt.h" 27 #include "randtmt32.h" 28 #include "randtmt64.h" 26 29 27 30 #endif -
trunk/SophyaLib/BaseTools/ppersist.cc
r3426 r4051 167 167 } 168 168 169 //! Return true if the specified PPersist class is found in the registered class list 170 bool 171 PIOPersist::checkPPClassId(PPersist const & ppo) 172 { 173 string typ_name = typeid(ppo).name() ; 174 map<string, uint_8>::iterator i = ppclassNameList->find(typ_name); 175 if (i == ppclassNameList->end()) return false; 176 return true; 177 } 169 178 170 179 //! Returns the PPersist class name for the specified classId -
trunk/SophyaLib/BaseTools/ppersist.h
r2805 r4051 46 46 47 47 virtual void Write(POutPersist&) const; 48 v oidRead(PInPersist& s); // Reads the type tag and the object48 virtual void Read(PInPersist& s); // Reads the type tag and the object 49 49 void Write(POutPersist&, string const& tag) const; 50 50 void ReadAtTag(PInPersist& s, string const& tag); … … 85 85 static uint_8 getPPClassId(string const & typ_name); 86 86 static uint_8 getPPClassId(PPersist const & ppo); 87 static bool checkPPClassId(PPersist const & ppo); 88 87 89 static string getDataObjClassName(uint_8 classId); 88 90 static uint_8 getDataObjClassId(string const & typ_name); -
trunk/SophyaLib/BaseTools/ppfwrapstlv.h
r2805 r4051 63 63 inline operator std::vector<T>() { return(*dobj); } 64 64 65 virtual void Write(POutPersist& os) const 66 { 67 if (!PIOPersist::checkPPClassId(*this)) { // on enregistre la classe 68 PPRegister(PPFWrapperSTLVector< T >); 69 DObjRegister(PPFWrapperSTLVector< T >, std::vector< T >); 70 } 71 PPersist::Write(os); 72 } 73 virtual void Read(PInPersist& os) 74 { 75 if (!PIOPersist::checkPPClassId(*this)) { // on enregistre la classe 76 PPRegister(PPFWrapperSTLVector< T >); 77 DObjRegister(PPFWrapperSTLVector< T >, std::vector< T >); 78 } 79 PPersist::Read(os); 80 } 81 65 82 protected : 66 83 virtual void ReadSelf(PInPersist& is) … … 73 90 // On efface le contenu du vecteur si necessaire - (on peut faire plus efficacement ...) 74 91 if ( dobj->size() > 0) dobj->erase(dobj->begin(), dobj->end()); 75 T el;76 92 for(uint_8 k=0; k<itab[1]; k++) { 93 T el; 77 94 is >> el; 78 95 dobj->push_back(el);
Note: See TracChangeset
for help on using the changeset viewer.