[2688] | 1 | // This may look like C code, but it is really -*- C++ -*-
|
---|
| 2 | // Class DataTable (Row-Column data table in memory)
|
---|
| 3 | // R. Ansari - Avril 2005
|
---|
| 4 | // (C) LAL-IN2P3/CNRS CEA-DAPNIA
|
---|
| 5 |
|
---|
| 6 | #ifndef DATATABLE_H_SEEN
|
---|
| 7 | #define DATATABLE_H_SEEN
|
---|
| 8 |
|
---|
| 9 | #include "basedtable.h"
|
---|
| 10 | #include "objfio.h"
|
---|
| 11 |
|
---|
| 12 |
|
---|
| 13 | namespace SOPHYA {
|
---|
| 14 |
|
---|
| 15 | // Forward class declaration for Fits handler
|
---|
| 16 | class FITS_DataTable;
|
---|
| 17 |
|
---|
| 18 | class DataTable : public BaseDataTable {
|
---|
| 19 | public:
|
---|
| 20 | DataTable(sa_size_t segsz=512);
|
---|
| 21 | DataTable(DataTable const& a, bool share=true);
|
---|
| 22 |
|
---|
| 23 | virtual sa_size_t AddColumn(FieldType ft, string const & cnom);
|
---|
| 24 |
|
---|
| 25 | // Pour la gestion de persistance PPF
|
---|
| 26 | friend class ObjFileIO<DataTable> ;
|
---|
| 27 | // pour fichiers FITS
|
---|
| 28 | friend class FITS_DataTable;
|
---|
| 29 |
|
---|
| 30 | //! Reset the table content and structure
|
---|
| 31 | void Clear();
|
---|
| 32 | protected:
|
---|
| 33 | void Share(DataTable const & a);
|
---|
| 34 | void Clone(DataTable const & a);
|
---|
| 35 |
|
---|
| 36 | // Donnees en memoire
|
---|
| 37 | std::vector< SegDataBlock<int_4> > mICols;
|
---|
| 38 | std::vector< SegDataBlock<int_8> > mLCols;
|
---|
| 39 | std::vector< SegDataBlock<r_4> > mFCols;
|
---|
| 40 | std::vector< SegDataBlock<r_8> > mDCols;
|
---|
| 41 | std::vector< SegDataBlock<string> > mSCols;
|
---|
| 42 | };
|
---|
| 43 |
|
---|
| 44 | /*! Writes the object in the POutPersist stream \b os */
|
---|
| 45 | inline POutPersist& operator << (POutPersist& os, DataTable & obj)
|
---|
| 46 | { ObjFileIO<DataTable> fio(&obj); fio.Write(os); return(os); }
|
---|
| 47 | /*! Reads the object from the PInPersist stream \b is */
|
---|
| 48 | inline PInPersist& operator >> (PInPersist& is, DataTable & obj)
|
---|
| 49 | { ObjFileIO<DataTable> fio(&obj); is.SkipToNextObject(); fio.Read(is); return(is); }
|
---|
| 50 | // Classe pour la gestion de persistance
|
---|
| 51 | // ObjFileIO<DataTable>
|
---|
| 52 | } // namespace SOPHYA
|
---|
| 53 |
|
---|
| 54 | #endif
|
---|
| 55 |
|
---|