- Timestamp:
- Jun 9, 2005, 6:20:00 PM (20 years ago)
- Location:
- trunk/SophyaLib/BaseTools
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/BaseTools/dvlist.h
r2477 r2805 77 77 virtual void Print(ostream& os) const; 78 78 79 //! \cond 79 80 // Chaque element dans un DVList est constitue desormais d'un MuTyV 80 81 // et d'une chaine de caracteres (commentaire) regroupe dans la structure 81 82 // dvlElement. Ces elements sont associes aux noms de variables dans un 82 83 // map<...> ValList. Reza 02/2000 83 84 84 struct dvlElement {MuTyV elval; string elcomm; } ; 85 85 typedef map<string, dvlElement, less<string> > ValList; 86 //! \endcond 86 87 /*! Returns an iterator pointing on the first variable in the list */ 87 88 inline ValList::const_iterator Begin() { return(mvlist.begin()); } -
trunk/SophyaLib/BaseTools/fiondblock.cc
r2615 r2805 17 17 // Les objets delegues pour la gestion de persistance 18 18 // ------------------------------------------------------------------------- 19 /*! 20 \class SOPHYA::FIO_NDataBlock 21 \ingroup BaseTools 22 Handler for PPF persistence of NDataBlock<T> classes. 23 */ 19 24 20 25 /* -
trunk/SophyaLib/BaseTools/fiosegdb.h
r2687 r2805 13 13 #include <typeinfo> 14 14 15 namespace SOPHYA {16 17 15 /*! 18 16 \class SOPHYA::FIO_SegDataBlock … … 20 18 Class implementing PPF persistence (PPersist handler) for segmented data structures 21 19 (class SegDataBlock). 20 \sa PPersist 22 21 */ 22 23 namespace SOPHYA { 24 23 25 24 26 template <class T> -
trunk/SophyaLib/BaseTools/gnumd5.h
r1416 r2805 6 6 #endif 7 7 8 /*! \cond */ 8 9 typedef struct { 9 10 uint_8 mem_align; /* To force memory alignment on SunOS 22/02/2001 */ … … 13 14 int count; 14 15 } MD5_CONTEXT; 15 16 /*! \endcond */ 16 17 17 18 void -
trunk/SophyaLib/BaseTools/hashtable.h
r552 r2805 12 12 namespace SOPHYA { 13 13 14 //! \cond 14 15 template <class T, class K> 15 16 struct HashtableEntry { … … 19 20 HashtableEntry<T,K> *next; 20 21 }; 21 22 //! \endcond 22 23 23 24 template <class T, class K> -
trunk/SophyaLib/BaseTools/objfio.h
r2698 r2805 11 11 #include "anydataobj.h" 12 12 #include "ppersist.h" 13 14 /*! 15 \class SOPHYA::ObjFileIO 16 \ingroup BaseTools 17 Template class to ease implementation of PPersist handlers for a 18 class T , inheriting from AnyDataObj. The methodes ReadSelf() and 19 WriteSelf() must be implemented. 20 \sa PPersist 21 */ 13 22 14 23 namespace SOPHYA { -
trunk/SophyaLib/BaseTools/ppersist.cc
r2698 r2805 21 21 22 22 23 #define MAXTAGLEN 255 23 24 /*! 25 \class SOPHYA::PIOPersist 26 \ingroup BaseTools 27 Handles (statically) the registration of PPF Sophya Persistence) handler classes. 28 \sa PPersist 29 */ 30 24 31 25 32 //++ … … 32 39 //-- 33 40 34 //++35 // Links See36 // PPersist37 // PInPersist38 // POutPersist39 //--40 41 42 41 MD5_CONTEXT PIOPersist::ctx; 43 42 PIOPersist::ClassList * PIOPersist::ppclassList = NULL; // $CHECK$ Reza 26/04/99 … … 57 56 } 58 57 59 //++ 58 /*! 59 Register a new persistence handler (PPersist) class. 60 The classId is usually a hash of the class< name, and 61 ppclass_name is typeid(PPersistClass).name() . 62 This method is called only through the PPersistRegistrar template 63 */ 60 64 void 61 65 PIOPersist::RegisterPPHandlerClass(uint_8 classId, string ppclass_name, ClassCreatorFunc f) 62 //63 // Register a new persistence handler (PPersist) class.64 // The classId is usually a hash of the class< name, and65 // ppclass_name is typeid(PPersistClass).name() .66 // This method is called only through the PPersistRegistrar template67 //68 //--69 66 { 70 67 if (ppclassList->size() && (ppclassList->find(classId) != ppclassList->end()) ) { … … 83 80 } 84 81 85 //++ 82 /*! 83 Register a new DataObj class corresponding to a PPersist classId 84 class_typename should be typeid(DataObject).name() 85 */ 86 86 void 87 87 PIOPersist::RegisterDataObjClass(uint_8 classId, string class_name) 88 // Register a new DataObj class corresponding to a PPersist classId89 // class_typename should be typeid(DataObject).name()90 //--91 88 { 92 89 if (ppclassList->find(classId) == ppclassList->end() ) { … … 132 129 } 133 130 131 //! Returns the PPersist class creator function for the specified classId 134 132 PIOPersist::ClassCreatorFunc 135 133 PIOPersist::FindCreatorFunc(uint_8 classId) 136 // Returns the PPersist class creator function for the specified classId137 134 { 138 135 ClassList::iterator i = ppclassList->find(classId); … … 141 138 } 142 139 140 //! Returns the PPersist class name for the specified classId 143 141 string 144 142 PIOPersist::getPPClassName(uint_8 classId) 145 // Returns the PPersist class name for the specified classId146 143 { 147 144 map<string, uint_8>::iterator i; … … 152 149 } 153 150 151 //! Returns the classId for the specified PPersist class type name 154 152 uint_8 155 153 PIOPersist::getPPClassId(string const & typ_name) 156 // Returns the classId for the specified PPersist class type name157 154 { 158 155 map<string, uint_8>::iterator i = ppclassNameList->find(typ_name); … … 162 159 } 163 160 161 //! Returns the classId for the specified PPersist class 164 162 uint_8 165 163 PIOPersist::getPPClassId(PPersist const & ppo) 166 // Returns the classId for the specified PPersist class167 164 { 168 165 string typ_name = typeid(ppo).name() ; … … 171 168 172 169 170 //! Returns the PPersist class name for the specified classId 173 171 string 174 172 PIOPersist::getDataObjClassName(uint_8 classId) 175 // Returns the PPersist class name for the specified classId176 173 { 177 174 map<string, uint_8>::iterator i; … … 182 179 } 183 180 181 //! Returns the classId for the specified PPersist class type name 184 182 uint_8 185 183 PIOPersist::getDataObjClassId(string const & typ_name) 186 // Returns the classId for the specified PPersist class type name187 184 { 188 185 map<string, uint_8>::iterator i = dobjclassNameList->find(typ_name); … … 192 189 } 193 190 191 //! Returns the classId for the specified PPersist class 194 192 uint_8 195 193 PIOPersist::getDataObjClassId(AnyDataObj const & o) 196 // Returns the classId for the specified PPersist class197 194 { 198 195 string typ_name = typeid(o).name() ; … … 200 197 } 201 198 199 //! \cond 202 200 static inline void bswap8_hash(void* p) 203 201 { … … 213 211 } 214 212 215 213 //! \endcond 216 214 217 215 uint_8 PIOPersist::Hash(string const& typname) { … … 238 236 // persistant : 239 237 // - Hériter de PPersist. 240 // - Définir un numéro d'identification de la classe, unique dans Peida241 // - Implémenter "ClassId()"242 238 // - Implémenter "WriteSelf" et "ReadSelf", qui doivent écrire toutes les variables 243 239 // membres que l'on souhaite écrire, et les relire dans le même ordre. … … 253 249 //-- 254 250 255 //++ 256 // Links See 257 // PInPersist 258 // POutPersist 259 // PIOPersist 260 //-- 261 262 //++ 251 /*! 252 \class SOPHYA::PPersist 253 \ingroup BaseTools 254 Ancestor (base) class for SOPHYA persistence (PPF) handlers. 255 In order to have provide a PPF handler for an object : 256 - Inherit from PPersist 257 - Implement WriteSelf() and ReadSelf() 258 259 \sa PInPersist POutPersist PIOPersist 260 */ 261 262 //! Writes the object into a new PPF file named \b fn 263 263 void 264 264 PPersist::Write(string const& fn) const 265 //266 // Ecrit l'objet dans un nouveau fichier ppersist "fn".267 //--268 265 { 269 266 POutPersist of(fn); … … 271 268 } 272 269 273 // ++270 //! Reads the object from a PInPersist stream created from file \b fn 274 271 void 275 272 PPersist::Read(string const& fn) 276 //277 // Relit l'objet dans le fichier ppersist "fn". Il faut connaître a priori278 // le type de l'objet. Pour une relecture avec création automatique du bon279 // objet, utiliser PPersistMgr::ReadObject.280 //--281 273 { 282 274 PInPersist inf(fn); … … 285 277 } 286 278 287 // ++279 //! Writes the object to the output PPF stream \b s 288 280 void 289 281 PPersist::Write(POutPersist& s) const 290 //291 // Ecrit l'objet dans le fichier PPersist.292 //--293 282 { 294 283 s.PutPPObject(this); … … 296 285 297 286 298 // ++287 //! Reads the object from the input PPF stream \b s 299 288 void 300 289 PPersist::Read(PInPersist& s) … … 337 326 } 338 327 339 // ++328 //! Writes a name tag (\b tag) and then the object to the output PPF stream \b s 340 329 void 341 330 PPersist::Write(POutPersist& s, string const& tag) const 342 //343 // Ecrit l'objet dans le fichier PPersist avec un tag344 //--345 331 { 346 332 s.WriteNameTag(tag); … … 348 334 } 349 335 350 // ++336 //! Try to position at the name tag \b tag and then reads the object from the input stream \b s 351 337 void 352 338 PPersist::ReadAtTag(PInPersist& s, string const& tag) 353 //354 // Lit l'objet à la position du tag numéro "tagid".355 //--356 339 { 357 340 if (!s.GotoNameTag(tag)) … … 361 344 362 345 // Renvoie l'identificateur de l'objet - par defaut=0 363 346 /*! Return the object identifier (default: return 0) 347 (used for handling of PPF I/O for objects with reference sharing). 348 */ 364 349 uint_8 365 350 PPersist::getMemOId() const … … 370 355 // Ces deux methodes doivent etre redefinies si getMemOId() renvoie non nul (>0) 371 356 // ShareDataReference() et CloneSharedReference() 357 /*! 358 This method should be re-implemented if getMemOId() non zero value. 359 (used for handling of PPF I/O for objects with reference sharing). 360 */ 372 361 void 373 362 PPersist::ShareDataReference(PPersist & pcs) … … 376 365 } 377 366 367 /*! 368 This method should be re-implemented if getMemOId() non zero value. 369 (used for handling of PPF I/O for objects with reference sharing). 370 */ 378 371 PPersist * 379 372 PPersist::CloneSharedReference() … … 403 396 //-- 404 397 398 /*! 399 \class SOPHYA::PInPersist 400 \ingroup BaseTools 401 This class implements the I/O read services necessary for SOPHYA 402 persistence (PPF) by extending the services provided by PPFBinaryInputStream. 403 \sa PPersist 404 */ 405 406 /*! Constructor from a RawInOutStream pointer 407 \param is : pointer to RawInOutStream 408 \param ad : if true, the RawInOutStream \b is is deleted by the destructor 409 \param scan : if true, try to read the name-tags table from the end of the input stream 410 */ 405 411 PInPersist::PInPersist(RawInOutStream * is, bool ad, bool scan) 406 412 : PPFBinaryInputStream(is, ad, scan) … … 408 414 } 409 415 416 /*! Constructor 417 \param flnm : input file name 418 \param scan : if true, try to read the name-tags table from the end of the input stream 419 */ 410 420 PInPersist::PInPersist(string const& flnm, bool scan) 411 421 : PPFBinaryInputStream(flnm, scan) … … 436 446 } 437 447 448 /*! Skip to next object in the streams, reads it and return 449 the corresponding PPersist handler 450 */ 438 451 PPersist* 439 452 PInPersist::ReadObject() … … 443 456 } 444 457 458 /*! 459 Tries to read in from the stream into object \b o 460 */ 445 461 void 446 462 PInPersist::GetObject(AnyDataObj & o) … … 450 466 } 451 467 468 /*! 469 Tries to move to \b nametag and then read in from the stream into object \b o 470 */ 452 471 void 453 472 PInPersist::GetObject(AnyDataObj & o, string tagname) … … 458 477 } 459 478 479 /*! 480 Reading of objects - used by GetObject() and ReadObject() 481 */ 460 482 PPersist* 461 483 PInPersist::GetPPObject(AnyDataObj * po) … … 575 597 576 598 599 /*! 600 \class SOPHYA::POutPersist 601 \ingroup BaseTools 602 This class implements the I/O write services necessary for SOPHYA 603 persistence (PPF) by extending the services provided by PPFBinaryOutputStream. 604 \sa PPersist 605 */ 606 577 607 //++ 578 608 // POutPersist(string const& flnm, int endianness = PPersist::PPS_NATIVE) … … 583 613 // ou PPersist::PPS_BIG_ENDIAN. 584 614 //-- 615 616 /*! Constructor from a RawInOutStream pointer 617 \param os : pointer to RawInOutStream 618 \param ad : if true, the RawInOutStream \b os is deleted by the destructor 619 \param endianness : Endianness selector PPS_NATIVE PPS_LITTLE_ENDIAN PPS_BIG_ENDIAN 620 */ 585 621 POutPersist::POutPersist(RawInOutStream* os, bool ad, int endianness) 586 622 : PPFBinaryOutputStream(os, ad, endianness) … … 590 626 } 591 627 628 /*! Constructor 629 \param flnm : output file name 630 \param endianness : Endianness selector PPS_NATIVE PPS_LITTLE_ENDIAN PPS_BIG_ENDIAN 631 */ 592 632 POutPersist::POutPersist(string const& flnm, int endianness) 593 633 : PPFBinaryOutputStream(flnm, endianness) … … 603 643 604 644 645 //! Writes the object \b o to the stream 605 646 void 606 647 POutPersist::PutObject(AnyDataObj & o) … … 614 655 } 615 656 657 //! Writes the nametag \b tagname and then the object \b o to the stream 616 658 void 617 659 POutPersist::PutObject(AnyDataObj & o, string tagname) -
trunk/SophyaLib/BaseTools/ppersist.h
r2774 r2805 68 68 69 69 70 //! Ancestor for PInPersist and POutPersist object serialisation streams.71 70 // Handles (statically) the registration of classes. 72 71 … … 169 168 }; 170 169 171 170 //! \cond 172 171 // Le macro suivant permettent de simplifier la declaration 173 172 // des operateurs >> << sur les POutPersist et PInPersist … … 215 214 216 215 #endif 217 216 217 //! \endcond 218 218 219 219 // --- Cela risque d'etre dangereux --- On le laisse au niveau des DataObj -
trunk/SophyaLib/BaseTools/ppfbinstream.cc
r2664 r2805 52 52 //------------------------------------------------------------------------- 53 53 54 /*! 55 \class SOPHYA::PPFBinaryIOStream 56 \ingroup BaseTools 57 Base class for SOPHYA PPF input / output stream 58 */ 59 54 60 55 61 PPFBinaryIOStream::PPFBinaryIOStream() … … 68 74 } 69 75 76 //! Return the creation date/time of the associated stream as a string 70 77 string 71 78 PPFBinaryIOStream::CreationDateStr() … … 76 83 } 77 84 85 //! Return a string with information about the stream (creation-date, version ...) 78 86 string 79 87 PPFBinaryIOStream::InfoString() … … 95 103 96 104 105 //! Return the name tag number \b itag 97 106 string 98 107 PPFBinaryIOStream::GetTagName(int itag) … … 105 114 106 115 116 //! Return a reference to a vector<string> containing all name-tags associated with the stream 107 117 static vector<string> * ret_tag_names = NULL; 108 118 vector<string> const & … … 120 130 //------------------------------------------------------------------------- 121 131 132 /*! 133 \class SOPHYA::PPFBinaryInputStream 134 \ingroup BaseTools 135 PPF Input stream implementing read operations 136 */ 137 138 /*! Constructor from a RawInOutStream pointer 139 \param is : pointer to RawInOutStream 140 \param ad : if true, the RawInOutStream \b is is deleted by the destructor 141 \param scan : if true, try to read the name-tags table from the end of the input stream 142 */ 122 143 PPFBinaryInputStream::PPFBinaryInputStream(RawInOutStream * is, bool ad, bool scan) 123 144 { … … 127 148 } 128 149 129 //++ 150 /*! Constructor 151 \param flnm : input file name 152 \param scan : if true, try to read the name-tags table from the end of the input stream 153 */ 130 154 PPFBinaryInputStream::PPFBinaryInputStream(string const& flnm, bool scan) 131 155 // … … 995 1019 } 996 1020 997 1021 /*! Scans the streams and prints in text format to standard output (cout) the PPF 1022 stream content. 1023 \param lev : print level (level of details) = 0,1,2,3 1024 */ 998 1025 void 999 1026 PPFBinaryInputStream::AnalyseTags(int lev) … … 1225 1252 //-- 1226 1253 1254 /*! 1255 \class SOPHYA::PPFBinaryInputStream 1256 \ingroup BaseTools 1257 PPF output stream implementing write operations. The byte-ordering (endianess) 1258 of the output stream can be selected at creation. By default, the native endianness 1259 of the machine is used. 1260 */ 1261 1262 /*! Constructor from a RawInOutStream pointer 1263 \param os : pointer to RawInOutStream 1264 \param ad : if true, the RawInOutStream \b os is deleted by the destructor 1265 \param endianness : Endianness selector PPS_NATIVE PPS_LITTLE_ENDIAN PPS_BIG_ENDIAN 1266 */ 1227 1267 PPFBinaryOutputStream::PPFBinaryOutputStream(RawInOutStream* os, bool ad, int endianness) 1228 1268 { … … 1232 1272 } 1233 1273 1274 /*! Constructor 1275 \param flnm : output file name 1276 \param endianness : Endianness selector PPS_NATIVE PPS_LITTLE_ENDIAN PPS_BIG_ENDIAN 1277 */ 1234 1278 PPFBinaryOutputStream::PPFBinaryOutputStream(string const& flnm, int endianness) 1235 1279 { -
trunk/SophyaLib/BaseTools/ppfnametag.h
r2484 r2805 7 7 8 8 #include "ppersist.h" 9 9 /*! 10 \class SOPHYA::PPFNameTag 11 \ingroup BaseTools 12 A simple class which can be used in conjuction with << and >> operators 13 to write nametags in POutPersist streams or position an input PInPersist 14 stream at a given nametag. 15 Nametags are strings which can be used to identify objects for further 16 retrieval in PPF streams. 17 Pushing a PPFNameTag(tname) to an output stream \b os corresponds to 18 so.WriteNameTag(tname). Extracting a PPFNameTag(tname) from an input stream 19 \b is corresponds to is.GotoNameTag(tname). 20 21 \code 22 { 23 // Writing a name tag and an object to a stream 24 NDataBlock<int_4> idb(16); 25 idb = 16; 26 POutPersist so("myfile.ppf"); 27 so << PPFNameTag("MyIDB") << idb ; 28 } 29 //... 30 { 31 // Positioning and Reading from a PPF stream 32 PInPersist si("myfile.ppf"); 33 NDataBlock<int_4> idb; 34 si >> PPFNameTag("MyIDB") >> idb; 35 } 36 \endcode 37 */ 10 38 //---------------------------------------------------------------------- 11 39 namespace SOPHYA { -
trunk/SophyaLib/BaseTools/ppfswapper.h
r2794 r2805 12 12 #include "ppftpointerio.h" 13 13 14 namespace SOPHYA {15 14 /*! 16 15 \class SOPHYA::PPFDataSwapper … … 18 17 Implementation of SOPHYA::DataSwapperInterface interface on PPF streams 19 18 (POutPersist , PInPersist) to be used with SOPHYA::SwSegDataBlock classes. 19 the identifier idx is not used in this implementation. In case of re-writing 20 to swap, the previous position is ignored, the data is re-written to swap 21 and a new swap position is returned. 20 22 */ 23 24 namespace SOPHYA { 21 25 22 26 template <class T> -
trunk/SophyaLib/BaseTools/ppftpointerio.cc
r2704 r2805 10 10 //---------------------------------------------------------------------- 11 11 namespace SOPHYA { 12 12 //! \cond 13 13 // Specific implementation using table I/O in PPFBinaryIOStreams 14 14 /* DECL_TEMP_SPEC equivalent a template <> , pour SGI-CC en particulier */ … … 79 79 { is.Get(arr,n); } 80 80 81 //! \endcond 81 82 82 83 } // namespace SOPHYA -
trunk/SophyaLib/BaseTools/ppftpointerio.h
r2704 r2805 9 9 10 10 //---------------------------------------------------------------------- 11 namespace SOPHYA {12 13 11 /*! 14 12 \class SOPHYA::PPF_TPointer_IO … … 21 19 new types and classes. 22 20 */ 21 22 namespace SOPHYA { 23 23 24 24 template <class T> … … 37 37 }; 38 38 39 //! \cond 39 40 // declaration specifique pour ecriture sous forme de tableaux PPF 40 41 DECL_TEMP_SPEC /* equivalent a template <> , pour SGI-CC en particulier */ … … 123 124 }; 124 125 126 //! \endcond 125 127 } // namespace SOPHYA 126 128 -
trunk/SophyaLib/BaseTools/ppfwrapstlv.h
r2665 r2805 14 14 #include <iostream> 15 15 16 namespace SOPHYA {17 18 16 /*! 19 17 \class SOPHYA::PPFWrapperSTLVector … … 27 25 using the macro \b PPRegister(PPFWrapperSTLVector<T>) 28 26 */ 27 28 namespace SOPHYA { 29 29 30 30 31 template <class T> -
trunk/SophyaLib/BaseTools/rcptr.h
r287 r2805 4 4 #define RCPTR_H 5 5 6 // This implements a very simple "smart pointer" with reference counting. 7 // Many refinements are possible 6 /*! 7 \class RCPtr 8 \ingroup BaseTools 9 This implements a very simple "smart pointer" with reference counting. 10 Many refinements are possible 11 Eric Aubourg 1999 CEA/DAPNIA/SPP 8 12 9 // Principle : use RCPtr<T> instead of T* 10 // To use with type X, define 11 // typedef RCPtr<X> Xp; 12 // When creating a new object, use 13 // Xp xp = new X(...); 14 // xp can be used like a X* xp->field, xp->method(), *xp ... 15 // can be passed by reference, copied, etc 16 // the object is destroyed when the last Xp is destroyed. 13 \verbatim 14 Principle : use RCPtr<T> instead of T* 15 To use with type X, define 16 typedef RCPtr<X> Xp; 17 When creating a new object, use 18 Xp xp = new X(...); 19 xp can be used like a X* xp->field, xp->method(), *xp ... 20 can be passed by reference, copied, etc 21 the object is destroyed when the last Xp is destroyed. 17 22 18 // The class RCCPtr<X> is a const smart pointer, to be used like 19 // a X const *. 20 21 // Eric Aubourg 1999 CEA/DAPNIA/SPP 22 23 The class RCCPtr<X> is a const smart pointer, to be used like 24 a X const *. 25 \endverbatim 26 */ 23 27 24 28 template <class T> class RCCPtr; … … 69 73 70 74 71 // A const smart pointer75 //! A const smart pointer class 72 76 template <class T> 73 77 class RCCPtr { -
trunk/SophyaLib/BaseTools/segdatablock.h
r2698 r2805 14 14 #include <typeinfo> 15 15 16 namespace SOPHYA {17 18 ////////////////////////////////////////////////////////////////19 //// ---------------- Class SegDBInterface ------------------ //20 //// ----------------- Class SegDataBlock ------------------- //21 ////////////////////////////////////////////////////////////////22 23 16 /*! 24 17 \class SOPHYA::SegDBInterface … … 26 19 Interface definition for segmented data container (template class). 27 20 */ 21 /*! 22 \class SOPHYA::SegDataBlock 23 \ingroup BaseTools 24 Template class impementing segmented data container in memory with 25 management of reference sharing. 26 */ 27 28 namespace SOPHYA { 29 30 //////////////////////////////////////////////////////////////// 31 //// ---------------- Class SegDBInterface ------------------ // 32 //// ----------------- Class SegDataBlock ------------------- // 33 //////////////////////////////////////////////////////////////// 34 28 35 template <class T> 29 36 class SegDBInterface : public AnyDataObj { … … 49 56 }; 50 57 58 51 59 // classe de container avec partage de reference 52 //! Segmented data container with reference sharing53 /*!54 \class SOPHYA::SegDataBlock55 \ingroup BaseTools56 Template class impementing segmented data container in memory with57 management of reference sharing.58 */59 60 template <class T> 60 61 class SegDataBlock : public SegDBInterface<T> { … … 242 243 mSRef = NULL; 243 244 } 244 //! SDREF structure for reference management - for internal use by SegDataBlock 245 /*! \cond 246 SDREF structure for reference management - for internal use by SegDataBlock 247 */ 245 248 typedef struct { 246 size_t nref; // !<Number of references to the data structure247 uint_8 dsid; // !<Data structure Id - Used by FIO_SegDataBlock249 size_t nref; // Number of references to the data structure 250 uint_8 dsid; // Data structure Id - Used by FIO_SegDataBlock 248 251 std::vector<T *> dseg; 249 252 size_t segsize; 250 253 } SDREF; 251 254 /*! \endcond */ 252 255 SDREF * mSRef; //!< SDREF structure for reference sharing 253 256 }; -
trunk/SophyaLib/BaseTools/swsegdb.h
r2698 r2805 12 12 #include <typeinfo> 13 13 14 namespace SOPHYA {15 16 ////////////////////////////////////////////////////////////////17 //// ------------- Class DataSwapperInterface --------------- //18 //// ---------------- Class SwSegDataBlock ------------------ //19 ////////////////////////////////////////////////////////////////20 21 14 /*! 22 15 \class SOPHYA::DataSwapperInterface … … 25 18 with SOPHYA::SwSegDataBlock classes. 26 19 */ 27 template <class T>28 class DataSwapperInterface {29 public:30 virtual ~DataSwapperInterface() { }31 //! Swap out the data array pointed by \b d with size \b sz32 virtual int_8 WriteToSwap(const T * d, size_t sz, int_8 idx, int_8 oswp=0, bool osw=false) = 0;33 //! Swap in the data array pointed by \b d with size \b sz34 virtual void ReadFromSwap(int_8 idx, int_8 swp, T* d, size_t sz) = 0;35 };36 37 //! Segmented data structure with swap management38 20 /*! 39 21 \class SOPHYA::SwSegDataBlock … … 41 23 Segmented data structure with swap space management. 42 24 */ 25 26 namespace SOPHYA { 27 28 //////////////////////////////////////////////////////////////// 29 //// ------------- Class DataSwapperInterface --------------- // 30 //// ---------------- Class SwSegDataBlock ------------------ // 31 //////////////////////////////////////////////////////////////// 32 33 template <class T> 34 class DataSwapperInterface { 35 public: 36 virtual ~DataSwapperInterface() { } 37 /*! Swap out the data array pointed by \b d with size \b sz 38 Return the swap position which might be used later to retrieve the data from swap 39 \param d : Pointer to the memory segment 40 \param sz : Number of elements (type T) 41 \param idx : An integer which might be used to identify the data (optional) 42 \param oswp : Old swap position, if the data has already been swapped 43 \param osw : true -> data has already been swapped 44 */ 45 virtual int_8 WriteToSwap(const T * d, size_t sz, int_8 idx, int_8 oswp=0, bool osw=false) = 0; 46 /*! Swap in the data array pointed by \b d with size \b sz 47 Retrieves the data from swap space and copies it to \b d 48 \param idx : optional data identifier 49 \param swp : swap position (obtained from a previous call to WriteToSwap() 50 \param d : pointer to T , where the data will be copied from swap space 51 \param sz : Number of data elements (type T) 52 */ 53 virtual void ReadFromSwap(int_8 idx, int_8 swp, T* d, size_t sz) = 0; 54 }; 55 43 56 template <class T> 44 57 class SwSegDataBlock : public SegDBInterface<T> { … … 172 185 } 173 186 187 //! \cond 174 188 typedef struct { 175 189 size_t nref; // Number of references to the data structure … … 183 197 DataSwapperInterface<T> * swapper; // Data swapper 184 198 } SWSDREF; 185 199 //! \endcond 186 200 SWSDREF * mSRef; // SWSDREF structure for reference sharing 187 201 }; -
trunk/SophyaLib/BaseTools/timestamp.cc
r2666 r2805 9 9 #include <iostream> 10 10 11 /*! 12 \class SOPHYA::TimeStamp 13 \ingroup BaseTools 14 A simple class for representing date and time. Simple operations 15 on date/time are also provided. 16 17 \code 18 // Create a object with the current date and time and prints it to cout 19 TimeStamp ts; 20 cout << ts << endl; 21 // Create an object with a specified date and time 22 TimeStamp ts2("01/01/1905","00:00:00"); 23 // Get the number of days since 0 Jan 1901 24 cout << ts2.ToDays() << endl; 25 \endcode 26 */ 27 11 28 #ifdef Linux 12 29 // La fonction trunc non declaree ds math.h sous Linux … … 16 33 //-------------------------- Classe TimeStamp -------------------------- 17 34 //------------------------------------------------------------------------- 35 18 36 enum Jour {jour_Lundi=0, jour_Mardi, jour_Mercredi, jour_Jeudi, jour_Vendredi, jour_Samedi, jour_Dimanche}; 19 37 enum Mois {mois_Janvier=1, mois_Fevrier, mois_Mars, mois_Avril, mois_Mai, mois_Juin, mois_Juillet,
Note:
See TracChangeset
for help on using the changeset viewer.