Changeset 588 in Sophya for trunk/SophyaLib/BaseTools/ppersist.h
- Timestamp:
- Nov 17, 1999, 4:47:03 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/BaseTools/ppersist.h
r582 r588 69 69 typedef PPersist* (*ClassCreatorFunc)(); 70 70 71 static void RegisterClass(uint_8 classId, ClassCreatorFunc f);71 static void RegisterClass(uint_8 classId, string typname, ClassCreatorFunc f); 72 72 static ClassCreatorFunc FindCreatorFunc(uint_8 classId); 73 73 static uint_8 Hash(string const& typname) { … … 80 80 81 81 static void Initialize(); // Pour initialiser classList 82 static uint_8 getTypeId(string s) {return (*typeids)[s];} 82 83 private: 83 84 … … 85 86 // Pas de createur appele pour objets statiques sur Linux - $CHECK$ Reza 26/04/99 86 87 static ClassList * classList; 88 static map<string, uint_8> * typeids; 87 89 88 90 protected: 91 89 92 enum {PPS_NULL = 0, // this is a null object 90 93 PPS_STRING = 1, // string, length (2b) + data … … 94 97 PPS_EOF = 5, // Just before tag infomation, offset to PPS_TAG 95 98 PPS_LINE = 6, // '\n'-terminated, deprecated ? 99 PPS_TAG_MARK = 7, // to reset object count when skipped 96 100 PPS_SIMPLE = 16, // 16 + number of bytes, up to 8 bytes 97 101 PPS_SIMPLE_ARRAY = 32, // 32 + number of bytes, up to 8 bytes, then 2 bytes of length … … 166 170 void CheckTag (short datasz); 167 171 void CheckArrayTag(short datasz, size_t sz); 172 void GetTypeTag (char& c); 168 173 void GetRawByte (char& c); 169 174 void GetRawBytes(void* ptr, size_t bytes); … … 319 324 public: 320 325 static PPersist* Create() {return new T();} 321 static void Register(string id) {PIOPersist::RegisterClass(Hash(id), Create);}326 static void Register(string id) {PIOPersist::RegisterClass(Hash(id),typeid(T).name(),Create);} 322 327 static uint_8 Hash(string id) { 323 328 return PIOPersist::Hash(id);
Note:
See TracChangeset
for help on using the changeset viewer.