- Timestamp:
- Mar 10, 2006 8:26:54 AM (18 years ago)
- Location:
- trunk/src/mesh
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/mesh/serializer.cc
r313 r314 9 9 { 10 10 const char* key = obj->objectName(); 11 11 12 // add object pointer to object map 12 13 m_objMap[key] = obj; … … 105 106 RpSerializer::getObject(const char* objectName) 106 107 { 108 #ifdef DEBUG 109 printf("RpSerializer::getObject: %s, len=%d\n", objectName,strlen(objectName)); 110 #endif 107 111 typeObjMap::iterator iter = m_objMap.find(objectName); 108 112 … … 271 275 typeObjMap::iterator iter; 272 276 for (iter = m_objMap.begin(); iter != m_objMap.end(); iter++) 273 printf("objMap: %s \t%x\n", (*iter).first, (unsigned)(*iter).second);277 printf("objMap: %s= ptr=%x\n", (*iter).first, (unsigned)(*iter).second); 274 278 275 279 typeRefCount::iterator it; 276 280 for (it = m_refCount.begin(); it != m_refCount.end(); it++) 277 printf("count: %s \t%d\n", (*it).first, (*it).second);281 printf("count: %s= count=%d\n", (*it).first, (*it).second); 278 282 }; 279 283 … … 292 296 293 297 if (header == RpGrid1d_current_version) { 294 obj = new RpGrid1d ; // create new object298 obj = new RpGrid1d(); // create new object 295 299 obj->deserialize(buf); 296 300 return obj; -
trunk/src/mesh/serializer.h
r308 r314 62 62 RpSerializable* createObject(std::string header, const char* buf); 63 63 64 struct rpStrCmp { 65 bool operator()( const char* s1, const char* s2 ) const { 66 return strcmp( s1, s2 ) < 0; 67 } 68 }; 69 64 70 private: 65 typedef map<const char*, RpSerializable* > typeObjMap;66 typedef map<const char*, int > typeRefCount;71 typedef map<const char*, RpSerializable*, rpStrCmp> typeObjMap; 72 typedef map<const char*, int, rpStrCmp> typeRefCount; 67 73 68 74 // archive of objects referenced by their names (e.g., output.field)
Note: See TracChangeset
for help on using the changeset viewer.