38 #define G_INSERT "GFitsTableBitCol::insert(int&, int&)"
39 #define G_REMOVE "GFitsTableBitCol::remove(int&, int&)"
40 #define G_LOAD_COLUMN "GFitsTableBitCol::load_column()"
41 #define G_SAVE_COLUMN "GFitsTableBitCol::save_column()"
42 #define G_GET_BIT "GFitsTableBitCol::get_bit(int&,int&)"
138 if (
this != &column) {
262 bool bit = (*this)(row, inx);
265 std::string result = (bit) ?
"T" :
"F";
283 bool bit = (*this)(row, inx);
286 double result = (bit) ? 1.0 : 0.0;
304 bool bit = (*this)(row, inx);
307 int result = (bit) ? 1 : 0;
357 int length = m_length +
nrows;
370 unsigned char* new_data =
new unsigned char[
m_size];
380 unsigned char* src =
m_data;
381 unsigned char* dst = new_data;
382 for (
int i = 0; i < n_before; ++i) {
385 for (
int i = 0; i < n_insert; ++i) {
388 for (
int i = 0; i < n_after; ++i) {
430 if (nrows < 0 || nrows >
m_length-row) {
462 unsigned char* new_data =
new unsigned char[
m_size];
472 unsigned char* src =
m_data;
473 unsigned char* dst = new_data;
474 for (
int i = 0; i < n_before; ++i) {
478 for (
int i = 0; i < n_after; ++i) {
548 #if defined(G_CALL_GRAPH)
549 printf(
"GFitsTableBitCol::init_members\n");
565 #if defined(G_CALL_GRAPH)
566 printf(
"exit GFitsTableBitCol::init_members\n");
608 for (
int i = 0; i <
m_size; ++i)
616 #if defined(G_SMALL_MEMORY)
633 #if defined(G_CALL_GRAPH)
634 printf(
"GFitsTableBitCol::free_members\n");
649 #if defined(G_CALL_GRAPH)
650 printf(
"exit GFitsTableBitCol::free_members\n");
683 #if defined(G_CALL_GRAPH)
684 printf(
"GFitsTableBitCol::alloc_data(%d)\n",
m_size);
699 #if defined(G_CALL_GRAPH)
700 printf(
"exit GFitsTableBitCol::alloc_data(m_data=%x)\n",
m_data);
798 for (
int i = 0; i <
m_size; ++i) {
847 std::string msg =
"FITS HDU number "+
849 " not found in FITS file.";
858 "for column \""+
m_name+
"\".");
893 std::string msg =
"FITS HDU number "+
895 " not found in FITS file.";
929 #if defined(G_RANGE_CHECK)
937 #if defined(G_RANGE_CHECK)
int m_bits
Total number of Bits in column.
virtual void release_data(void)
Release column data.
virtual int integer(const int &row, const int &col=0) const
Get integer value.
std::string number(const std::string &noun, const int &number)
Convert singular noun into number noun.
int m_colnum
Column number (starting from 1). This parameter is used to signal if a table column corresponds to a ...
void free_members(void)
Delete class members.
virtual void resize_data(const int &index, const int &number)
Resize column data.
int m_anynul
Number of NULLs encountered.
virtual std::string string(const int &row, const int &col=0) const
Get string value.
virtual ~GFitsTableBitCol(void)
Destructor.
virtual GFitsTableBitCol * clone(void) const
Clone column.
int m_number
Number of elements in column.
void free_members(void)
Delete class members.
bool m_bit_value
Actual bit to be accessed.
GFitsTableCol & operator=(const GFitsTableCol &column)
Assignment operator.
virtual void insert(const int &row, const int &nrows)
Insert rows in column.
virtual void clear(void)
Clear instance.
unsigned char * m_data
Data area.
void init_members(void)
Initialise class members.
bool m_bit_pending
Bit value has to be written back.
void copy_members(const GFitsTableBitCol &column)
Copy class members.
int m_varlen
Maximum number of elements in variable-length.
#define __ffgcv(A, B, C, D, E, F, G, H, I, J)
bool & operator()(const int &row, const int &inx=0)
Column data access operator.
unsigned char * m_nulval
NULL value.
virtual double real(const int &row, const int &col=0) const
Get double precision value.
int m_bits_per_row
Number of Bits per row.
#define __ffmahd(A, B, C, D)
void init_members(void)
Initialise class members.
CFITSIO interface header.
Abstract interface for FITS table column.
std::vector< int > m_rowstart
Start index of each row.
FITS table bit column class interface definition.
GFitsTableBitCol & operator=(const GFitsTableBitCol &column)
Assignment operator.
std::string m_name
Column name.
int m_length
Length of column (number of rows)
unsigned char * nulval(void)
Returns pointer to nul value.
virtual bool is_loaded(void) const
Checks if column has been loaded.
virtual void alloc_data(void)
Allocates column data.
int m_bit_byte
Row of actual bit to be accessed.
virtual void remove(const int &row, const int &nrows)
Remove rows from column.
int m_size
Size of allocated data area (0 if not loaded)
#define __ffpcn(A, B, C, D, E, F, G, H, I)
virtual void fetch_data(void) const
Fetch column data.
void get_bit(const int &row, const int &inx)
Get Bit for boolean access.
Exception handler interface definition.
virtual void save_column(void)
Save table column into FITS file.
int m_bit_mask
Index of actual bit to be accessed.
void * m_fitsfile
FITS file pointer associated with column.
const int & nrows(void) const
Returns number of rows in column.
GFitsTableBitCol(void)
Constructor.
int m_bytes_per_row
Number of Bytes per row.
virtual void load_column(void)
Load table column from FITS file.
void set_pending(void)
Set pending Bit.
virtual std::string ascii_format(void) const
Returns format string of ASCII table.
virtual void init_data(void)
Initialise column data.
int m_width
Width in Bytes of single column element.
void alloc_nulval(const unsigned char *value)
Allocates null value.
std::string str(const unsigned short int &value)
Convert unsigned short integer value into string.