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

Last change on this file since 1423 was 1397, checked in by ansari, 25 years ago

Ajout operateur >> et << pour PPersist des LocalMap et SphericalMap - Reza 12/2/2001

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
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
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)
54{ FIO_LocalMap<T> fio(&obj); fio.Read(is); return(is); }
55
56
57} // Fin du namespace
58
59#endif
Note: See TracBrowser for help on using the repository browser.