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

Last change on this file since 2699 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
RevLine 
[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
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
[2693]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
[2691]29 inline DataTable& operator = (DataTable const& a)
30 { CopyMerge(a, true) ; return *this ; }
31
[2688]32 // Pour la gestion de persistance PPF
[2699]33 friend class ObjFileIO<BaseDataTable> ;
[2688]34 // pour fichiers FITS
35 friend class FITS_DataTable;
36
37 //! Reset the table content and structure
[2699]38 virtual void Clear();
[2688]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)
[2699]53{ ObjFileIO<BaseDataTable> fio(&obj); fio.Write(os); return(os); }
[2688]54/*! Reads the object from the PInPersist stream \b is */
55inline PInPersist& operator >> (PInPersist& is, DataTable & obj)
[2699]56{ ObjFileIO<BaseDataTable> fio(&obj); is.SkipToNextObject();
57 fio.Read(is); return(is); }
[2688]58// Classe pour la gestion de persistance
[2699]59// ObjFileIO<BaseDataTable>
[2688]60} // namespace SOPHYA
61
62#endif
63
Note: See TracBrowser for help on using the repository browser.