38 #define G_INSERT "GFitsTableUShortCol::insert(int&, int&)"
39 #define G_REMOVE "GFitsTableUShortCol::remove(int&, int&)"
133 if (
this != &column) {
325 int length = m_length +
nrows;
331 unsigned short* new_data =
new unsigned short[
m_size];
338 int n_after =
m_number * (m_length - row);
341 unsigned short* src =
m_data;
342 unsigned short* dst = new_data;
343 for (
int i = 0; i < n_before; ++i) {
346 for (
int i = 0; i < n_insert; ++i) {
349 for (
int i = 0; i < n_after; ++i) {
391 if (nrows < 0 || nrows >
m_length-row) {
413 unsigned short* new_data =
new unsigned short[
m_size];
420 int n_after =
m_number * (length - row);
423 unsigned short* src =
m_data;
424 unsigned short* dst = new_data;
425 for (
int i = 0; i < n_before; ++i) {
429 for (
int i = 0; i < n_after; ++i) {
535 for (
int i = 0; i <
m_size; ++i) {
544 #if defined(G_SMALL_MEMORY)
651 unsigned short* dst =
m_data + index;
654 for (
int i = 0; i < num; ++i) {
668 unsigned short* new_data =
new unsigned short[
m_size];
669 unsigned short* dst = new_data;
670 unsigned short* src =
m_data;
671 for (
int i = 0; i < index; ++i) {
674 for (
int i = 0; i <
number; ++i) {
677 for (
int i = 0; i <
left; ++i) {
737 for (
int i = 0; i <
m_size; ++i) {
virtual ~GFitsTableUShortCol(void)
Destructor.
void init_members(void)
Initialise class members.
std::string number(const std::string &noun, const int &number)
Convert singular noun into number noun.
virtual void resize_data(const int &index, const int &number)
Resize column data.
virtual void clear(void)
Clear instance.
virtual void insert(const int &row, const int &nrows)
Insert rows in column.
unsigned short & operator()(const int &row, const int &inx=0)
Column data access operator.
int m_number
Number of elements in column.
void free_members(void)
Delete class members.
GFitsTableCol & operator=(const GFitsTableCol &column)
Assignment operator.
virtual void alloc_data(void)
Allocates column data.
virtual void release_data(void)
Release column data.
GFitsTableUShortCol & operator=(const GFitsTableUShortCol &column)
Assignment operator.
unsigned short * m_data
Data vector.
int m_varlen
Maximum number of elements in variable-length.
virtual GFitsTableUShortCol * clone(void) const
Clone column.
virtual void load_column(void)
Load table column from FITS file.
virtual void fetch_data(void) const
Fetch column data.
virtual std::string string(const int &row, const int &col=0) const
Get string value.
const int & number(void) const
Returns number of elements in column.
virtual int integer(const int &row, const int &col=0) const
Get integer value.
virtual bool is_loaded(void) const
Checks if column has been loaded.
void copy_members(const GFitsTableUShortCol &column)
Copy class members.
void free_members(void)
Delete class members.
void init_members(void)
Initialise class members.
virtual std::string ascii_format(void) const
Returns format string of ASCII table.
CFITSIO interface header.
GFitsTableUShortCol(void)
Constructor.
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.
FITS table unsigned short integer column class interface definition.
void alloc_nulval(const unsigned short *value)
Allocates null value.
int m_length
Length of column (number of rows)
unsigned short * nulval(void)
Returns pointer to nul value.
virtual void init_data(void)
Initialise column data.
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)
unsigned short * m_nulval
NULL value.
FITS table unsigned short integer column.
virtual double real(const int &row, const int &col=0) const
Get double precision value.
virtual int offset(const int &row, const int &inx) const
Compute offset of column element in memory.
Exception handler interface definition.
const int & nrows(void) const
Returns number of rows in column.
std::string str(const unsigned short int &value)
Convert unsigned short integer value into string.