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 SWFITSDTABLE_H_SEEN
|
---|
7 | #define SWFITSDTABLE_H_SEEN
|
---|
8 |
|
---|
9 | #include "basedtable.h"
|
---|
10 | #include "swsegdb.h"
|
---|
11 | #include "fitsswapper.h"
|
---|
12 |
|
---|
13 |
|
---|
14 | namespace SOPHYA {
|
---|
15 |
|
---|
16 | //! An implementation of BaseDataTable with using FITS files as swap space.
|
---|
17 | class SwFitsDataTable : public BaseDataTable {
|
---|
18 | public:
|
---|
19 | SwFitsDataTable(sa_size_t segsz=512);
|
---|
20 | SwFitsDataTable(FitsInOutFile & os, sa_size_t segsz=512, bool fgcreate=true);
|
---|
21 | SwFitsDataTable(SwFitsDataTable const& a);
|
---|
22 |
|
---|
23 | virtual ~SwFitsDataTable();
|
---|
24 |
|
---|
25 | virtual sa_size_t AddColumn(FieldType ft, string const & cnom);
|
---|
26 |
|
---|
27 | // Filling data structures (adding lines)
|
---|
28 | virtual sa_size_t AddLine(const r_8* data);
|
---|
29 | virtual sa_size_t AddLine(const MuTyV * data);
|
---|
30 |
|
---|
31 | //! Equal (copy) operator - Copies the structure and shares the data \b a
|
---|
32 | inline SwFitsDataTable& operator = (SwFitsDataTable const& a)
|
---|
33 | { Clear(); Share(a); return *this ; }
|
---|
34 |
|
---|
35 |
|
---|
36 | //! Reset(Clear) the table content and structure
|
---|
37 | virtual void Clear();
|
---|
38 | /*! This method should be called in order to empty the swapout buffer,
|
---|
39 | before saving object to PPF stream
|
---|
40 | */
|
---|
41 | void SwapOutAll() const;
|
---|
42 |
|
---|
43 | // Pour la gestion I/O FITS
|
---|
44 | friend class FitsHandler<BaseDataTable> ;
|
---|
45 |
|
---|
46 | protected:
|
---|
47 | void Share(SwFitsDataTable const & a);
|
---|
48 | // Methode pour utilisation par FitsHandler<BaseDataTable>
|
---|
49 | sa_size_t AddColRd(FieldType ft, string const & cnom, vector<int_8> const * swpos=NULL);
|
---|
50 |
|
---|
51 |
|
---|
52 | // Donnees (SegDataBlock) et leurs swapper
|
---|
53 | std::vector< SwSegDataBlock<int_4> > mICols;
|
---|
54 | std::vector< SwSegDataBlock<int_8> > mLCols;
|
---|
55 | std::vector< SwSegDataBlock<r_4> > mFCols;
|
---|
56 | std::vector< SwSegDataBlock<r_8> > mDCols;
|
---|
57 | std::vector< SwSegDataBlock< complex<r_4> > > mYCols;
|
---|
58 | std::vector< SwSegDataBlock< complex<r_8> > > mZCols;
|
---|
59 | std::vector< SwSegDataBlock<string> > mSCols;
|
---|
60 |
|
---|
61 | // In/Out swap file doit etre cree avant l'appel au constructeur
|
---|
62 | // et rester valide (non detruit) tant que l'objet SwFitsDataTable existe
|
---|
63 | FitsInOutFile mSwF;
|
---|
64 | bool mFgCreate; // true -> creation de table, false -> lecture
|
---|
65 | };
|
---|
66 |
|
---|
67 | } // namespace SOPHYA
|
---|
68 |
|
---|
69 | #endif
|
---|
70 |
|
---|