Ignore:
Timestamp:
Jun 9, 2005, 6:20:00 PM (20 years ago)
Author:
ansari
Message:

MAJ commentaires pour documentation doxygen - Reza 9 Juin 2005

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaLib/BaseTools/ppersist.cc

    r2698 r2805  
    2121
    2222
    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
    2431
    2532//++
     
    3239//--
    3340
    34 //++
    35 // Links        See
    36 // PPersist
    37 // PInPersist
    38 // POutPersist
    39 //--
    40 
    41 
    4241MD5_CONTEXT PIOPersist::ctx;
    4342PIOPersist::ClassList * PIOPersist::ppclassList = NULL;   // $CHECK$ Reza 26/04/99
     
    5756}
    5857
    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*/
    6064void
    6165PIOPersist::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, and
    65 //      ppclass_name is typeid(PPersistClass).name() .
    66 //      This method is called only through the PPersistRegistrar template
    67 //
    68 //--
    6966{
    7067  if (ppclassList->size() && (ppclassList->find(classId) != ppclassList->end()) ) {
     
    8380}
    8481
    85 //++
     82/*!
     83  Register a new DataObj class corresponding to a PPersist classId
     84  class_typename should be typeid(DataObject).name()
     85*/
    8686void
    8787PIOPersist::RegisterDataObjClass(uint_8 classId, string class_name)
    88 //      Register a new DataObj class corresponding to a PPersist classId
    89 //      class_typename should be typeid(DataObject).name()
    90 //--
    9188{
    9289  if (ppclassList->find(classId) == ppclassList->end() ) {
     
    132129}
    133130
     131//! Returns the PPersist class creator function for the specified classId
    134132PIOPersist::ClassCreatorFunc
    135133PIOPersist::FindCreatorFunc(uint_8 classId)
    136 // Returns the PPersist class creator function for the specified classId
    137134{
    138135  ClassList::iterator i = ppclassList->find(classId);
     
    141138}
    142139
     140//! Returns the PPersist class name for the specified classId
    143141string
    144142PIOPersist::getPPClassName(uint_8 classId)
    145 // Returns the PPersist class name for the specified classId
    146143{
    147144  map<string, uint_8>::iterator i;
     
    152149}
    153150
     151//! Returns the classId for the specified PPersist class type name
    154152uint_8
    155153PIOPersist::getPPClassId(string const & typ_name)
    156 // Returns the classId for the specified PPersist class type name
    157154{
    158155  map<string, uint_8>::iterator i = ppclassNameList->find(typ_name);
     
    162159}
    163160
     161//! Returns the classId for the specified PPersist class
    164162uint_8
    165163PIOPersist::getPPClassId(PPersist const & ppo)
    166 // Returns the classId for the specified PPersist class
    167164{
    168165  string typ_name = typeid(ppo).name() ;
     
    171168
    172169
     170//! Returns the PPersist class name for the specified classId
    173171string
    174172PIOPersist::getDataObjClassName(uint_8 classId)
    175 // Returns the PPersist class name for the specified classId
    176173{
    177174  map<string, uint_8>::iterator i;
     
    182179}
    183180
     181//! Returns the classId for the specified PPersist class type name
    184182uint_8
    185183PIOPersist::getDataObjClassId(string const & typ_name)
    186 // Returns the classId for the specified PPersist class type name
    187184{
    188185  map<string, uint_8>::iterator i = dobjclassNameList->find(typ_name);
     
    192189}
    193190
     191//! Returns the classId for the specified PPersist class
    194192uint_8
    195193PIOPersist::getDataObjClassId(AnyDataObj const & o)
    196 // Returns the classId for the specified PPersist class
    197194{
    198195  string typ_name = typeid(o).name() ;
     
    200197}
    201198
     199//! \cond
    202200static inline void bswap8_hash(void* p)
    203201{
     
    213211}
    214212
    215 
     213//! \endcond
    216214
    217215uint_8 PIOPersist::Hash(string const& typname) {
     
    238236//      persistant :
    239237//      - Hériter de PPersist.
    240 //      - Définir un numéro d'identification de la classe, unique dans Peida
    241 //      - Implémenter "ClassId()"
    242238//      - Implémenter "WriteSelf" et "ReadSelf", qui doivent écrire toutes les variables
    243239//        membres que l'on souhaite écrire, et les relire dans le même ordre.
     
    253249//--
    254250
    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
    263263void
    264264PPersist::Write(string const& fn) const
    265 //
    266 //      Ecrit l'objet dans un nouveau fichier ppersist "fn".
    267 //--
    268265{
    269266  POutPersist of(fn);
     
    271268}
    272269
    273 //++
     270//! Reads the object from a PInPersist stream created from file \b fn
    274271void
    275272PPersist::Read(string const& fn)
    276 //
    277 //      Relit l'objet dans le fichier ppersist "fn". Il faut connaître a priori
    278 //      le type de l'objet. Pour une relecture avec création automatique du bon
    279 //      objet, utiliser PPersistMgr::ReadObject.
    280 //--
    281273{
    282274  PInPersist inf(fn);
     
    285277}
    286278
    287 //++
     279//! Writes the object to the output PPF stream \b s
    288280void
    289281PPersist::Write(POutPersist& s) const
    290 //
    291 //      Ecrit l'objet dans le fichier PPersist.
    292 //--
    293282{
    294283   s.PutPPObject(this);
     
    296285
    297286
    298 //++
     287//! Reads the object from the input PPF stream \b s
    299288void
    300289PPersist::Read(PInPersist& s)
     
    337326}
    338327
    339 //++
     328//! Writes a name tag (\b tag) and then the object to the output PPF stream \b s
    340329void
    341330PPersist::Write(POutPersist& s, string const& tag) const
    342 //
    343 //      Ecrit l'objet dans le fichier PPersist avec un tag
    344 //--
    345331{
    346332  s.WriteNameTag(tag);
     
    348334}
    349335
    350 //++
     336//! Try to position at the name tag \b tag and then reads the object from the input stream \b s
    351337void
    352338PPersist::ReadAtTag(PInPersist& s, string const& tag)
    353 //
    354 //      Lit l'objet à la position du tag numéro "tagid".
    355 //--
    356339{
    357340  if (!s.GotoNameTag(tag))
     
    361344
    362345// 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*/
    364349uint_8
    365350PPersist::getMemOId() const
     
    370355// Ces deux methodes doivent etre redefinies si   getMemOId() renvoie non nul (>0)
    371356// 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*/
    372361void
    373362PPersist::ShareDataReference(PPersist & pcs)
     
    376365}
    377366
     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*/
    378371PPersist *
    379372PPersist::CloneSharedReference()
     
    403396//--
    404397
     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*/
    405411PInPersist::PInPersist(RawInOutStream * is, bool ad, bool scan)
    406412  : PPFBinaryInputStream(is, ad, scan)
     
    408414}
    409415
     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*/ 
    410420PInPersist::PInPersist(string const& flnm, bool scan)
    411421  : PPFBinaryInputStream(flnm, scan)
     
    436446}
    437447
     448/*! Skip to next object in the streams, reads it and return
     449  the corresponding PPersist handler
     450*/
    438451PPersist*
    439452PInPersist::ReadObject()
     
    443456}
    444457
     458/*!
     459  Tries to read in from the stream into object \b o
     460*/
    445461void
    446462PInPersist::GetObject(AnyDataObj & o)
     
    450466}
    451467
     468/*!
     469  Tries to move to \b nametag and then read in from the stream into object \b o
     470*/
    452471void
    453472PInPersist::GetObject(AnyDataObj & o, string tagname)
     
    458477}
    459478
     479/*!
     480  Reading of objects - used by GetObject() and ReadObject()
     481*/
    460482PPersist*
    461483PInPersist::GetPPObject(AnyDataObj * po)
     
    575597
    576598
     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
    577607//++
    578608//  POutPersist(string const& flnm, int endianness = PPersist::PPS_NATIVE)
     
    583613//      ou PPersist::PPS_BIG_ENDIAN.
    584614//--
     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*/
    585621POutPersist::POutPersist(RawInOutStream* os, bool ad, int endianness)
    586622  : PPFBinaryOutputStream(os, ad, endianness)
     
    590626}
    591627
     628/*! Constructor
     629  \param flnm : output file name
     630  \param endianness : Endianness selector  PPS_NATIVE PPS_LITTLE_ENDIAN PPS_BIG_ENDIAN
     631*/
    592632POutPersist::POutPersist(string const& flnm, int endianness)
    593633  : PPFBinaryOutputStream(flnm, endianness)
     
    603643
    604644
     645//! Writes the object \b o to the stream
    605646void
    606647POutPersist::PutObject(AnyDataObj & o)
     
    614655}
    615656
     657//! Writes the nametag \b tagname and then the object \b o to the stream
    616658void
    617659POutPersist::PutObject(AnyDataObj & o, string tagname)
Note: See TracChangeset for help on using the changeset viewer.