38 #define G_INSERT "GFitsTableByteCol::insert(int&, int&)"
39 #define G_REMOVE "GFitsTableByteCol::remove(int&, int&)"
134 if (
this != &column) {
327 int length = m_length +
nrows;
333 unsigned char* new_data =
new unsigned char[
m_size];
340 int n_after =
m_number * (m_length - row);
343 unsigned char* src =
m_data;
344 unsigned char* dst = new_data;
345 for (
int i = 0; i < n_before; ++i) {
348 for (
int i = 0; i < n_insert; ++i) {
351 for (
int i = 0; i < n_after; ++i) {
393 if (nrows < 0 || nrows >
m_length-row) {
415 unsigned char* new_data =
new unsigned char[
m_size];
422 int n_after =
m_number * (length - row);
425 unsigned char* src =
m_data;
426 unsigned char* dst = new_data;
427 for (
int i = 0; i < n_before; ++i) {
431 for (
int i = 0; i < n_after; ++i) {
537 for (
int i = 0; i <
m_size; ++i) {
546 #if defined(G_SMALL_MEMORY)
653 unsigned char* dst =
m_data + index;
656 for (
int i = 0; i < num; ++i) {
670 unsigned char* new_data =
new unsigned char[
m_size];
671 unsigned char* dst = new_data;
672 unsigned char* src =
m_data;
673 for (
int i = 0; i < index; ++i) {
676 for (
int i = 0; i <
number; ++i) {
679 for (
int i = 0; i <
left; ++i) {
739 for (
int i = 0; i <
m_size; ++i) {
virtual GFitsTableByteCol * clone(void) const
Clone column.
void free_members(void)
Delete class members.
std::string number(const std::string &noun, const int &number)
Convert singular noun into number noun.
virtual void init_data(void)
Initialise column data.
virtual void clear(void)
Clear instance.
int m_number
Number of elements in column.
void free_members(void)
Delete class members.
GFitsTableCol & operator=(const GFitsTableCol &column)
Assignment operator.
virtual void insert(const int &row, const int &nrows)
Insert rows in column.
int m_varlen
Maximum number of elements in variable-length.
virtual int integer(const int &row, const int &col=0) const
Get integer value.
unsigned char * m_nulval
NULL value.
unsigned char * m_data
Data vector.
virtual void load_column(void)
Load table column from FITS file.
virtual void release_data(void)
Release column data.
const int & number(void) const
Returns number of elements in column.
void alloc_nulval(const unsigned char *value)
Allocates null value.
virtual ~GFitsTableByteCol(void)
Destructor.
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.
std::string left(const std::string &s, const int &n, const char &c= ' ')
Left justify string to achieve a length of n characters.
unsigned char & operator()(const int &row, const int &inx=0)
Column data access operator.
void init_members(void)
Initialise class members.
virtual void alloc_data(void)
Allocates column data.
virtual void resize_data(const int &index, const int &number)
Resize column data.
GFitsTableByteCol & operator=(const GFitsTableByteCol &column)
Assignment operator.
int m_length
Length of column (number of rows)
virtual double real(const int &row, const int &col=0) const
Get double precision value.
virtual std::string ascii_format(void) const
Returns format string of ASCII table.
int m_size
Size of allocated data area (0 if not loaded)
GFitsTableByteCol(void)
Constructor.
virtual int offset(const int &row, const int &inx) const
Compute offset of column element in memory.
virtual bool is_loaded(void) const
Checks if column has been loaded.
Exception handler interface definition.
unsigned char * nulval(void)
Returns pointer to nul value.
virtual void remove(const int &row, const int &nrows)
Remove rows from column.
FITS table Byte column class interface definition.
void copy_members(const GFitsTableByteCol &column)
Copy class members.
virtual std::string string(const int &row, const int &col=0) const
Get string value.
const int & nrows(void) const
Returns number of rows in column.
virtual void fetch_data(void) const
Fetch column data.
std::string str(const unsigned short int &value)
Convert unsigned short integer value into string.