Last change
on this file since 3870 was 2477, checked in by ansari, 22 years ago |
Suite et presque fin de l'extension des fonctionalites de la persistence PPF - fonctionalite pour le swap en particulier - Reza 7 Dec 2003
|
File size:
1.4 KB
|
Line | |
---|
1 | // This may look like C code, but it is really -*- C++ -*-
|
---|
2 | // Classe pour la gestion de persistance pour NDataBlock<T>
|
---|
3 | // C.Magneville 04/99-03/2000
|
---|
4 | // LAL (Orsay) / IN2P3-CNRS DAPNIA/SPP (Saclay) / CEA
|
---|
5 |
|
---|
6 | #ifndef FIONDATABLOCK_H
|
---|
7 | #define FIONDATABLOCK_H
|
---|
8 |
|
---|
9 | #include "machdefs.h"
|
---|
10 | #include "ppersist.h"
|
---|
11 | #include "ndatablock.h"
|
---|
12 | #include <iostream>
|
---|
13 |
|
---|
14 | namespace SOPHYA {
|
---|
15 |
|
---|
16 | template <class T>
|
---|
17 | class FIO_NDataBlock : public PPersist {
|
---|
18 | public:
|
---|
19 | FIO_NDataBlock();
|
---|
20 | FIO_NDataBlock(string const & filename);
|
---|
21 | FIO_NDataBlock(const NDataBlock<T> & obj);
|
---|
22 | FIO_NDataBlock(NDataBlock<T> * obj);
|
---|
23 | virtual ~FIO_NDataBlock();
|
---|
24 | virtual AnyDataObj* DataObj();
|
---|
25 | virtual void SetDataObj(AnyDataObj & o);
|
---|
26 | inline operator NDataBlock<T>() { return(*dobj); }
|
---|
27 |
|
---|
28 | virtual uint_8 getMemOId() const ;
|
---|
29 | virtual void ShareDataReference(PPersist &);
|
---|
30 | virtual PPersist* CloneSharedReference();
|
---|
31 |
|
---|
32 | protected :
|
---|
33 | virtual void ReadSelf(PInPersist&);
|
---|
34 | virtual void WriteSelf(POutPersist&) const;
|
---|
35 | NDataBlock<T> * dobj;
|
---|
36 | bool ownobj;
|
---|
37 | };
|
---|
38 |
|
---|
39 | template <class T>
|
---|
40 | inline POutPersist& operator << (POutPersist& os, NDataBlock<T> & obj)
|
---|
41 | { FIO_NDataBlock<T> fio(&obj); fio.Write(os); return(os); }
|
---|
42 | template <class T>
|
---|
43 | inline PInPersist& operator >> (PInPersist& is, NDataBlock<T> & obj)
|
---|
44 | { FIO_NDataBlock<T> fio(&obj); is.SkipToNextObject(); fio.Read(is); return(is); }
|
---|
45 |
|
---|
46 | } // Fin du namespace
|
---|
47 |
|
---|
48 | #endif
|
---|
Note:
See
TracBrowser
for help on using the repository browser.