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

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

Ajout operateur = (DataTable const& a) pour la classe DataBlock<T> , Reza 26/4/2005

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