Last change
on this file since 2322 was 2322, checked in by cmv, 23 years ago |
- passage xxstream.h en xxstream
- compile avec gcc_3.2, gcc_2.96 et cxx
En 3.2 le seek from ::end semble marcher (voir Eval/COS/pbseekios.cc)
rz+cmv 11/2/2003
|
File size:
1.4 KB
|
Rev | Line | |
---|
[802] | 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"
|
---|
[2322] | 12 | #include <iostream>
|
---|
[802] | 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); fio.Read(is); return(is); }
|
---|
| 45 |
|
---|
| 46 | } // Fin du namespace
|
---|
| 47 |
|
---|
| 48 | #endif
|
---|
Note:
See
TracBrowser
for help on using the repository browser.