27 #ifndef GFITSTABLECOL_HPP
28 #define GFITSTABLECOL_HPP
63 virtual void clear(
void) = 0;
65 virtual std::string
classname(
void)
const = 0;
66 virtual std::string
string(
const int& row,
const int& inx = 0)
const = 0;
67 virtual double real(
const int& row,
const int& inx = 0)
const = 0;
68 virtual int integer(
const int& row,
const int& inx = 0)
const = 0;
69 virtual void insert(
const int& row,
const int&
nrows) = 0;
70 virtual void remove(
const int& row,
const int&
nrows) = 0;
75 const std::string&
name(
void)
const;
77 const std::string&
unit(
void)
const;
78 void dim(
const std::vector<int>&
dim);
79 const std::vector<int>&
dim(
void)
const;
81 const int&
colnum(
void)
const;
83 const int&
type(
void)
const;
85 const int&
repeat(
void)
const;
87 const int&
width(
void)
const;
89 const int&
number(
void)
const;
93 const int&
nrows(
void)
const;
97 const int&
anynul(
void)
const;
99 const double&
tscale(
void)
const;
116 virtual void*
ptr_data(
const int& index = 0) = 0;
121 virtual void save(
void);
128 virtual int offset(
const int& row,
const int& inx)
const;
virtual void * ptr_nulval(void)=0
virtual GFitsTableCol * clone(void) const =0
Clones object.
virtual void init_data(void)=0
const int & anynul(void) const
Return number of NULLs encountered.
std::string number(const std::string &noun, const int &number)
Convert singular noun into number noun.
void connect(void *vptr)
Connect table column to FITS file.
int m_colnum
Column number (starting from 1). This parameter is used to signal if a table column corresponds to a ...
bool m_variable
Signals if column is variable length.
int m_anynul
Number of NULLs encountered.
int m_number
Number of elements in column.
virtual ~GFitsTableCol(void)
Destructor.
void free_members(void)
Delete class members.
double m_tscale
Optional scaling factor (1 = no scaling)
GFitsTableCol & operator=(const GFitsTableCol &column)
Assignment operator.
const std::string & name(void) const
Returns column name.
void elements(const int &row, const int &elements)
Set number of column elements for specific row.
Definition of interface for all GammaLib classes.
std::vector< int > m_dim
Column dimension.
int m_varlen
Maximum number of elements in variable-length.
const bool & is_variable(void) const
Signals if column is of variable length.
virtual void save_column_fixed(void)
Save table column into FITS file.
const std::string & unit(void) const
Returns column unit.
virtual void insert(const int &row, const int &nrows)=0
virtual void load_column(void)
Load table column from FITS file.
const int & colnum(void) const
Returns column number in FITS file (starting from 1)
virtual void alloc_data(void)=0
virtual std::string string(const int &row, const int &inx=0) const =0
virtual void load_column_variable(void)
Load variable-length column from FITS file.
const int & number(void) const
Returns number of elements in column.
std::string print(const GChatter &chatter=NORMAL) const
Print column information.
void init_members(void)
Initialise class members.
virtual void release_data(void)=0
std::string m_unit
Column unit.
Abstract interface for FITS table column.
Interface class for all GammaLib classes.
const double & tscale(void) const
Return TSCALE value.
std::vector< int > m_rowstart
Start index of each row.
int m_repeat
Repeat value of column.
const std::vector< int > & dim(void) const
Returns column dimension.
Abstract interface for FITS table.
std::string m_name
Column name.
virtual void save(void)
Save table column into FITS file.
virtual void resize_data(const int &index, const int &number)=0
const int & nrows(void) const
Return number of rows in table.
int m_length
Length of column (number of rows)
int colnum(const std::string &colname) const
Returns column number of a given column name.
const int & repeat(void) const
Returns column repeat value (only used for binary tables)
virtual void * ptr_data(const int &index=0)=0
virtual void clear(void)=0
Clear object.
virtual int integer(const int &row, const int &inx=0) const =0
virtual double real(const int &row, const int &inx=0) const =0
int m_size
Size of allocated data area (0 if not loaded)
virtual int offset(const int &row, const int &inx) const
Compute offset of column element in memory.
virtual bool is_loaded(void) const =0
void copy_members(const GFitsTableCol &column)
Copy class members.
GFitsTableCol(void)
Void constructor.
virtual void save_column(void)
Save table column into FITS file.
const int & type(void) const
Returns CFITSIO column type.
virtual void fetch_data(void) const =0
virtual void save_column_variable(void)
Save table column into FITS file.
void * m_fitsfile
FITS file pointer associated with column.
const int & nrows(void) const
Returns number of rows in column.
virtual std::string ascii_format(void) const =0
virtual void load_column_fixed(void)
Load fixed-length column from FITS file.
const int & width(void) const
Return width in Bytes of one column element.
int m_width
Width in Bytes of single column element.
virtual std::string classname(void) const =0
Return class name.
std::string tform_binary(void) const
Returns TFORM code for binary table column.