source: Sophya/trunk/SophyaLib/SkyMap/fiolocalmap.h@ 4018

Last change on this file since 4018 was 2479, checked in by ansari, 22 years ago

Ajout SkipToNextObjet() ds PInPersist operator >> - Reza 7 Dec 2003

File size: 1.4 KB
RevLine 
[842]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
18namespace SOPHYA {
19
20//! Delegated objects for persitance management
21template <class T>
22class FIO_LocalMap : public PPersist
23{
24
25public:
26
27FIO_LocalMap();
28FIO_LocalMap(string const & filename);
29FIO_LocalMap(const LocalMap<T>& obj);
30FIO_LocalMap(LocalMap<T>* obj);
31virtual ~FIO_LocalMap();
32virtual AnyDataObj* DataObj();
33virtual void SetDataObj(AnyDataObj & o);
34inline operator LocalMap<T>() { return(*dobj); }
35
36protected :
37
38virtual void ReadSelf(PInPersist&);
39virtual void WriteSelf(POutPersist&) const;
40LocalMap<T>* dobj;
41bool ownobj;
42};
43
[1397]44/*! \ingroup SkyMap \fn operator<<(POutPersist&,LocalMap<T>&)
45 \brief Write LocalMap \b obj into POutPersist stream \b os */
46template <class T>
47inline 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 */
52template <class T>
53inline PInPersist& operator >> (PInPersist& is, LocalMap<T> & obj)
[2479]54{ FIO_LocalMap<T> fio(&obj); is.SkipToNextObject(); fio.Read(is); return(is); }
[1397]55
56
[842]57} // Fin du namespace
58
59#endif
Note: See TracBrowser for help on using the repository browser.