Changeset 2657 in Sophya
- Timestamp:
- Apr 5, 2005, 5:37:54 PM (20 years ago)
- Location:
- trunk/SophyaLib/BaseTools
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/BaseTools/anydataobj.h
r895 r2657 16 16 AnyDataObj() { } 17 17 virtual ~AnyDataObj() { } 18 19 //! Return a process wide unique identifier 20 static uint_8 getUniqueId(); 18 21 }; 19 22 -
trunk/SophyaLib/BaseTools/ndatablock.cc
r2615 r2657 10 10 #include "pexceptions.h" 11 11 #include "ndatablock.h" 12 13 /* ---- Pour renvoyer un identificateur unique ---- */ 14 static uint_8 _ndrefid_ = 0; // Identificateur de NDREF cree 15 uint_8 AnyDataObj::getUniqueId() 16 { 17 _ndrefid_++; 18 return ( _ndrefid_ ); 19 } 12 20 13 21 /*! … … 310 318 */ 311 319 312 static uint_8 _ndrefid_ = 0; // Identificateur de NDREF cree313 320 314 321 template <class T> … … 327 334 mSRef = new NDREF; 328 335 mSRef->nref = 1; 329 mSRef->dsid = ++_ndrefid_;336 mSRef->dsid = AnyDataObj::getUniqueId(); 330 337 if(data) mSRef->data = data; 331 338 else {mSRef->data = new T[n]; if (zero) memset(mSRef->data,0,n*sizeof(T));} -
trunk/SophyaLib/BaseTools/ndatablock.h
r2565 r2657 110 110 inline T const* End() const {return mSRef->data+mSz;} 111 111 //! Return the number of references to the data structure 112 inline size_t NRef() const {if(mSRef) return 0; else return mSRef->nref;}112 inline size_t NRef() const {if(mSRef) return mSRef->nref; else return 0; } 113 113 114 114 // Impression -
trunk/SophyaLib/BaseTools/ppersist.cc
r2615 r2657 8 8 #include "anydataobj.h" 9 9 #include <iostream> 10 #include <iomanip> 10 11 #include <typeinfo> 11 12 … … 105 106 // class_typename should be typeid(DataObject).name(), to be 106 107 // used by POutPersist::PutDataObject() methods. 108 109 //! Lists the registered PPersist handler classes and the corresponding class id. 110 void 111 PIOPersist::ListPPHandlers() 112 { 113 cout << " PIOPersist::ListPPHandlers() - List of registered PPersist handler classes " << endl; 114 map<string, uint_8>::iterator it; 115 int k = 0; 116 for (it = (*ppclassNameList).begin(); it != (*ppclassNameList).end(); it++) { 117 cout << ++k << ": " << (*it).first << "\n" << " ClassId: Hex= " 118 << hex << (*it).second << " (Dec= " << dec << (*it).second << ")" << endl; 119 } 120 } 121 122 //! Lists the registered DataObj classes with the corresponding PPHandler name 123 void 124 PIOPersist::ListDataObjClasses() 125 { 126 cout << " PIOPersist::ListDataObjClasses() : Registered DataObj class list " << endl; 127 map<string, uint_8>::iterator it; 128 int k = 0; 129 for (it = (*dobjclassNameList).begin(); it != (*dobjclassNameList).end(); it++) { 130 cout << ++k << "- " << (*it).first << " -> " << getPPClassName((*it).second) << endl; 131 } 132 } 107 133 108 134 PIOPersist::ClassCreatorFunc -
trunk/SophyaLib/BaseTools/ppersist.h
r2477 r2657 77 77 static void RegisterPPHandlerClass(uint_8 classId, string ppclass_name, ClassCreatorFunc f); 78 78 static void RegisterDataObjClass(uint_8 classId, string class_name); 79 80 static void ListPPHandlers(); 81 static void ListDataObjClasses(); 79 82 80 83 static ClassCreatorFunc FindCreatorFunc(uint_8 classId);
Note:
See TracChangeset
for help on using the changeset viewer.