source: Sophya/trunk/SophyaExt/FitsIOServer/swfitsdtable.h@ 3049

Last change on this file since 3049 was 3032, checked in by ansari, 19 years ago

Declaration SwFitsDataTable::AddRow(DataTableRow) dans la classe fille , Reza 17/7/2006

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