source: Sophya/trunk/SophyaLib/HiStats/datatable.h@ 2743

Last change on this file since 2743 was 2699, checked in by ansari, 20 years ago

1/ Corrections diverses ds BaseDataTable, en particulier GetSegment() -> GetCstSegment(), et ameliorations/debug divers
2/ Classe SWPPFDataTable debugge, rendu +/- operationnelle
3/ Gestionnaire PPersist de DataTable et SWPPFDataTable fusionnee en une seule
classe ObjFileIO<BaseDataTable> - mis ds fio_dtable.cc
4/ mis a jour histats.h avec swppfdtable.h, objlist.list et histinit.cc

Reza, 27 Avril 2005

File size: 2.0 KB
Line 
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
13namespace SOPHYA {
14
15// Forward class declaration for Fits handler
16class FITS_DataTable;
17
18class DataTable : public BaseDataTable {
19public:
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 //! Equal (copy) operator - Copies the data and the structure if necessary from \b a
26 inline DataTable& operator = (BaseDataTable const& a)
27 { CopyMerge(a, true) ; return *this ; }
28 //! Equal (copy) operator - Copies the data and the structure if necessary from \b a
29 inline DataTable& operator = (DataTable const& a)
30 { CopyMerge(a, true) ; return *this ; }
31
32 // Pour la gestion de persistance PPF
33 friend class ObjFileIO<BaseDataTable> ;
34 // pour fichiers FITS
35 friend class FITS_DataTable;
36
37 //! Reset the table content and structure
38 virtual void Clear();
39protected:
40 void Share(DataTable const & a);
41 void Clone(DataTable const & a);
42
43 // Donnees en memoire
44 std::vector< SegDataBlock<int_4> > mICols;
45 std::vector< SegDataBlock<int_8> > mLCols;
46 std::vector< SegDataBlock<r_4> > mFCols;
47 std::vector< SegDataBlock<r_8> > mDCols;
48 std::vector< SegDataBlock<string> > mSCols;
49};
50
51/*! Writes the object in the POutPersist stream \b os */
52inline POutPersist& operator << (POutPersist& os, DataTable & obj)
53{ ObjFileIO<BaseDataTable> fio(&obj); fio.Write(os); return(os); }
54/*! Reads the object from the PInPersist stream \b is */
55inline PInPersist& operator >> (PInPersist& is, DataTable & obj)
56{ ObjFileIO<BaseDataTable> fio(&obj); is.SkipToNextObject();
57 fio.Read(is); return(is); }
58// Classe pour la gestion de persistance
59// ObjFileIO<BaseDataTable>
60} // namespace SOPHYA
61
62#endif
63
Note: See TracBrowser for help on using the repository browser.