| 
            Last change
 on this file since 3689 was             2479, checked in by ansari, 22 years ago           | 
        
        
          | 
             
Ajout SkipToNextObjet() ds PInPersist operator >> - Reza 7 Dec 2003 
 
           | 
        
        
          | 
            File size:
            1.4 KB
           | 
        
      
      
| Line |   | 
|---|
| 1 | // G. Le Meur 04/2000
 | 
|---|
| 2 | 
 | 
|---|
| 3 | #ifndef FIOLOCALMAP_SEEN
 | 
|---|
| 4 | #define FIOLOCALMAP_SEEN
 | 
|---|
| 5 | #include "sphericalmap.h"
 | 
|---|
| 6 | #include "localmap.h"
 | 
|---|
| 7 | #include "tvector.h"
 | 
|---|
| 8 | #include "ndatablock.h"
 | 
|---|
| 9 | 
 | 
|---|
| 10 | #include "anydataobj.h"
 | 
|---|
| 11 | #include "ppersist.h"
 | 
|---|
| 12 | 
 | 
|---|
| 13 | 
 | 
|---|
| 14 | //
 | 
|---|
| 15 | // ------------- Classes pour la gestion de persistance --
 | 
|---|
| 16 | //
 | 
|---|
| 17 | 
 | 
|---|
| 18 | namespace SOPHYA {
 | 
|---|
| 19 | 
 | 
|---|
| 20 | //!    Delegated objects for persitance management
 | 
|---|
| 21 | template <class T>
 | 
|---|
| 22 | class FIO_LocalMap : public PPersist  
 | 
|---|
| 23 | {
 | 
|---|
| 24 | 
 | 
|---|
| 25 | public:
 | 
|---|
| 26 | 
 | 
|---|
| 27 | FIO_LocalMap();
 | 
|---|
| 28 | FIO_LocalMap(string const & filename); 
 | 
|---|
| 29 | FIO_LocalMap(const LocalMap<T>& obj);
 | 
|---|
| 30 | FIO_LocalMap(LocalMap<T>* obj);
 | 
|---|
| 31 | virtual ~FIO_LocalMap();
 | 
|---|
| 32 | virtual AnyDataObj* DataObj();
 | 
|---|
| 33 | virtual void        SetDataObj(AnyDataObj & o);
 | 
|---|
| 34 | inline operator LocalMap<T>() { return(*dobj); }
 | 
|---|
| 35 | 
 | 
|---|
| 36 | protected :
 | 
|---|
| 37 | 
 | 
|---|
| 38 | virtual void ReadSelf(PInPersist&);           
 | 
|---|
| 39 | virtual void WriteSelf(POutPersist&) const;  
 | 
|---|
| 40 | LocalMap<T>* dobj;
 | 
|---|
| 41 | bool ownobj;
 | 
|---|
| 42 | };
 | 
|---|
| 43 | 
 | 
|---|
| 44 | /*! \ingroup SkyMap \fn operator<<(POutPersist&,LocalMap<T>&)
 | 
|---|
| 45 |   \brief Write LocalMap \b obj into POutPersist stream \b os */
 | 
|---|
| 46 | template <class T>
 | 
|---|
| 47 | inline POutPersist& operator << (POutPersist& os, LocalMap<T> & obj)
 | 
|---|
| 48 | { FIO_LocalMap<T> fio(&obj);  fio.Write(os);  return(os); }
 | 
|---|
| 49 | 
 | 
|---|
| 50 | /*! \ingroup SkyMap \fn operator>>(PInPersist&,LocalMap<T>&)
 | 
|---|
| 51 |   \brief Read LocalMap \b obj from PInPersist stream \b os */
 | 
|---|
| 52 | template <class T>
 | 
|---|
| 53 | inline PInPersist& operator >> (PInPersist& is, LocalMap<T> & obj)
 | 
|---|
| 54 | { FIO_LocalMap<T> fio(&obj); is.SkipToNextObject(); fio.Read(is); return(is); }
 | 
|---|
| 55 | 
 | 
|---|
| 56 | 
 | 
|---|
| 57 | } // Fin du namespace
 | 
|---|
| 58 | 
 | 
|---|
| 59 | #endif
 | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.