GammaLib
2.1.0.dev
|
COMPTEL Housekeeping Data collection class. More...
#include <GCOMHkds.hpp>
Public Member Functions | |
GCOMHkds (void) | |
Void constructor. More... | |
GCOMHkds (const GFilename &filename) | |
Filename constructor. More... | |
GCOMHkds (const GCOMHkds &hkds) | |
Copy constructor. More... | |
virtual | ~GCOMHkds (void) |
Destructor. More... | |
GCOMHkds & | operator= (const GCOMHkds &hkds) |
Assignment operator. More... | |
GCOMHkd & | operator[] (const int &index) |
Return reference to Housekeeping Data container. More... | |
const GCOMHkd & | operator[] (const int &index) const |
Return reference to Housekeeping Data (const version) More... | |
GCOMHkd & | operator[] (const std::string &name) |
Return reference to Housekeeping Data container. More... | |
const GCOMHkd & | operator[] (const std::string &name) const |
Return reference to Housekeeping Data container (const version) More... | |
void | clear (void) |
Clear Housekeeping Data collection. More... | |
GCOMHkds * | clone (void) const |
Clone Housekeeping Data collection. More... | |
std::string | classname (void) const |
Return class name. More... | |
GCOMHkd & | at (const int &index) |
Return reference to Housekeeping Data container. More... | |
const GCOMHkd & | at (const int &index) const |
Return reference to Housekeeping Data container (const version) More... | |
int | size (void) const |
Return number of Housekeeping parameters in collection. More... | |
bool | is_empty (void) const |
Signals if there are no Housekeeping Data containers in collection. More... | |
GCOMHkd & | set (const int &index, const GCOMHkd &hkd) |
Set Housekeeping Data container in collection. More... | |
GCOMHkd & | set (const std::string &name, const GCOMHkd &hkd) |
Set Housekeeping Data container in collection. More... | |
GCOMHkd & | append (const GCOMHkd &hkd) |
Append Housekeeping Data container to collection. More... | |
GCOMHkd & | insert (const int &index, const GCOMHkd &hkd) |
Insert Housekeeping Data container into collection. More... | |
void | remove (const int &index) |
Remove Housekeeping Data container from collection. More... | |
void | reserve (const int &num) |
Reserves space for Housekeeping Data containers in collection. More... | |
bool | contains (const std::string &name) const |
Signals if Housekeeping parameter exists in collection. More... | |
void | extend (const GCOMHkds &hkds) |
Extend Housekeeping Data collection. More... | |
void | load (const GFilename &filename) |
Load Housekeeping Data collection from FITS file. More... | |
void | read (const GFitsTable &table) |
Read Housekeeping Data collection from FITS table. More... | |
std::string | print (const GChatter &chatter=NORMAL) const |
Print Housekeeping Data collection. More... | |
Public Member Functions inherited from GContainer | |
virtual | ~GContainer (void) |
Destructor. More... | |
Public Member Functions inherited from GBase | |
virtual | ~GBase (void) |
Destructor. More... | |
Protected Member Functions | |
void | init_members (void) |
Initialise class members. More... | |
void | copy_members (const GCOMHkds &hkds) |
Copy class members. More... | |
void | free_members (void) |
Delete class members. More... | |
int | get_index (const std::string &name) const |
Return Housekeeping Data container index by parameter name. More... | |
Protected Attributes | |
std::vector< GCOMHkd > | m_hkds |
Housekeeping Data containers. More... | |
COMPTEL Housekeeping Data collection class.
The COMPTEL Housekeeping Data collection class holds Housekeeping Data containers for various parameters.
Definition at line 51 of file GCOMHkds.hpp.
GCOMHkds::GCOMHkds | ( | void | ) |
Void constructor.
Constructs an empty Housekeeping Data collection.
Definition at line 66 of file GCOMHkds.cpp.
References init_members().
Referenced by clone().
|
explicit |
Filename constructor.
[in] | filename | Housekeeping Data FITS file. |
Constructs a Housekeeping Data collection from a HKD FITS file.
Definition at line 83 of file GCOMHkds.cpp.
References init_members(), and load().
GCOMHkds::GCOMHkds | ( | const GCOMHkds & | hkds | ) |
Copy constructor.
[in] | hkds | Housekeeping Data collection. |
Definition at line 101 of file GCOMHkds.cpp.
References copy_members(), and init_members().
|
virtual |
Append Housekeeping Data container to collection.
[in] | hkd | Housekeeping Data container. |
Appends Housekeeping Data container to the collection by making a deep copy of specified container.
Definition at line 421 of file GCOMHkds.cpp.
GCOMHkd & GCOMHkds::at | ( | const int & | index | ) |
Return reference to Housekeeping Data container.
[in] | index | Housekeeping Data index [0,...,size()-1]. |
GException::out_of_range | Housekeeping Data container index is out of range. |
Returns a reference to the Housekeeping Data container with the specified index
.
Definition at line 269 of file GCOMHkds.cpp.
const GCOMHkd & GCOMHkds::at | ( | const int & | index | ) | const |
Return reference to Housekeeping Data container (const version)
[in] | index | Housekeeping Data index [0,...,size()-1]. |
GException::out_of_range | Housekeeping Data container index is out of range. |
Returns a reference to the Housekeeping Data container with the specified index
.
Definition at line 294 of file GCOMHkds.cpp.
|
inlinevirtual |
Return class name.
Implements GBase.
Definition at line 105 of file GCOMHkds.hpp.
|
virtual |
Clear Housekeeping Data collection.
Implements GBase.
Definition at line 233 of file GCOMHkds.cpp.
References free_members(), and init_members().
Referenced by GCOMObservation::init_members(), and read().
|
virtual |
Clone Housekeeping Data collection.
Implements GBase.
Definition at line 251 of file GCOMHkds.cpp.
References GCOMHkds().
bool GCOMHkds::contains | ( | const std::string & | name | ) | const |
Signals if Housekeeping parameter exists in collection.
[in] | name | Housekeeping parameter name. |
name
exists.Searches the collection for a given Housekeeping parameter name
. The method returns true
if the specified name
was found.
Definition at line 507 of file GCOMHkds.cpp.
References get_index().
Referenced by extend().
|
protected |
Copy class members.
[in] | hkds | Housekeeping Data collection. |
Definition at line 691 of file GCOMHkds.cpp.
References m_hkds.
Referenced by GCOMHkds(), and operator=().
void GCOMHkds::extend | ( | const GCOMHkds & | hkds | ) |
Extend Housekeeping Data collection.
[in] | hkds | Housekeeping Data collection. |
Extend Housekeeping Data collection by extending the container for each Housekeeping parameter.
Definition at line 525 of file GCOMHkds.cpp.
References append(), contains(), is_empty(), m_hkds, and size().
Referenced by GCOMObservation::load().
|
protected |
Delete class members.
Definition at line 704 of file GCOMHkds.cpp.
Referenced by clear(), operator=(), and ~GCOMHkds().
|
protected |
Return Housekeeping Data container index by parameter name.
[in] | name | Housekeeping parameter name. |
Returns Housekeeping Data container index based on the specified housekeeping parameter name
. If no Housekeeping Data container with the specified name
is found the method returns -1.
Definition at line 722 of file GCOMHkds.cpp.
References m_hkds, and size().
Referenced by contains(), operator[](), read(), and set().
|
protected |
Initialise class members.
Definition at line 676 of file GCOMHkds.cpp.
References m_hkds.
Referenced by clear(), GCOMHkds(), and operator=().
Insert Housekeeping Data container into collection.
[in] | index | Housekeeping Data container index (0,...,size()-1). |
[in] | hkd | Housekeeping Data container. |
GException::out_of_range | Housekeeping Data container index is out of range. |
Inserts an Housekeeping
Data container into the collection before the Housekeeping Data container with the specified index
.
Definition at line 444 of file GCOMHkds.cpp.
References G_INSERT, is_empty(), m_hkds, and size().
|
inlinevirtual |
Signals if there are no Housekeeping Data containers in collection.
Signals if the collection does not contain any Housekeeping Data containers.
Implements GContainer.
Definition at line 166 of file GCOMHkds.hpp.
References m_hkds.
Referenced by extend(), insert(), and GCOMObservation::print().
void GCOMHkds::load | ( | const GFilename & | filename | ) |
Load Housekeeping Data collection from FITS file.
[in] | filename | COMPTEL HKD FITS file name. |
Load a Housekeeping Data collection from a HKD FITS file into the collection.
Definition at line 561 of file GCOMHkds.cpp.
References GFits::close(), read(), and GFits::table().
Referenced by GCOMHkds().
Assignment operator.
[in] | hkds | Housekeeping Data collection. |
Definition at line 139 of file GCOMHkds.cpp.
References copy_members(), free_members(), and init_members().
|
inline |
Return reference to Housekeeping Data container.
[in] | index | Housekeeping Data container index [0,...,size()-1]. |
Returns a reference to the Housekeeping Data container with the specified index
.
Definition at line 121 of file GCOMHkds.hpp.
References m_hkds.
|
inline |
Return reference to Housekeeping Data (const version)
[in] | index | Housekeeping Data container index [0,...,size()-1]. |
Returns a reference to the Housekeeping Data container with the specified index
.
Definition at line 137 of file GCOMHkds.hpp.
References m_hkds.
GCOMHkd & GCOMHkds::operator[] | ( | const std::string & | name | ) |
Return reference to Housekeeping Data container.
[in] | name | Housekeeping parameter name. |
GException::invalid_argument | Housekeeping parameter with specified name not found in collection. |
Returns a reference to the Housekeeping Data container with the specified name
. An exception is thrown if the specified name
is not found in the collection.
Definition at line 174 of file GCOMHkds.cpp.
References G_ACCESS, get_index(), and m_hkds.
const GCOMHkd & GCOMHkds::operator[] | ( | const std::string & | name | ) | const |
Return reference to Housekeeping Data container (const version)
[in] | name | Housekeeping parameter name. |
GException::invalid_argument | Housekeeping parameter with specified name not found in collection. |
Returns a reference to the Housekeeping Data container with the specified name
. An exception is thrown if the specified name
is not found in the collection.
Definition at line 206 of file GCOMHkds.cpp.
References G_ACCESS, get_index(), and m_hkds.
Print Housekeeping Data collection.
[in] | chatter | Chattiness. |
Implements GBase.
Definition at line 639 of file GCOMHkds.cpp.
References gammalib::parformat(), SILENT, size(), and gammalib::str().
Referenced by GCOMObservation::print().
void GCOMHkds::read | ( | const GFitsTable & | table | ) |
Read Housekeeping Data collection from FITS table.
[in] | table | COMPTEL HKD FITS table. |
Reads a Housekeeping Data collection from a FITS table into the collection.
Definition at line 588 of file GCOMHkds.cpp.
References GCOMHkd::append(), append(), clear(), gammalib::com_time(), get_index(), GFitsTableCol::integer(), GFitsTable::nrows(), GFitsTableCol::real(), and GFitsTableCol::string().
Referenced by load().
|
virtual |
Remove Housekeeping Data container from collection.
[in] | index | Housekeeping Data container index (0,...,size()-1). |
GException::out_of_range | Housekeeping Data container index is out of range. |
Remove Housekeeping Data container of specified index
from collection.
Implements GContainer.
Definition at line 480 of file GCOMHkds.cpp.
|
inlinevirtual |
Reserves space for Housekeeping Data containers in collection.
[in] | num | Number of Housekeeping Data containers in collection. |
Reserves space for num
Housekeeping Data containers in the collection.
Implements GContainer.
Definition at line 180 of file GCOMHkds.hpp.
References m_hkds.
Set Housekeeping Data container in collection.
[in] | index | Housekeeping Data container index [0,...,size()[. |
[in] | hkd | Housekeeping Data container. |
GException::out_of_range | Housekeeping Data container index is out of range. |
GException::invalid_value | Housekeeping parameter exists already in collection at other index. |
Set Housekeeping Data container in the collection. Note that each housekeeping parameter can only exist once in an collection, hence an exception will be thrown if the same housekeeping parameter exists already at another index. A deep copy of the Housekeeping Data container will be made.
Definition at line 326 of file GCOMHkds.cpp.
References G_SET1, get_index(), m_hkds, GCOMHkd::name(), size(), and gammalib::str().
Set Housekeeping Data container in collection.
[in] | name | Housekeeping parameter name. |
[in] | hkd | Housekeeping Data container. |
GException::invalid_argument | Housekeeping parameter with specified name not found in collection. |
GException::invalid_value | Name of Housekeeping parameter exists already in collection. |
Set Housekeeping Data container in the collection replacing the container with the specified Housekeeping parameter name
. Note that each housekeeping parameter can only exist once in an collection, hence an exception will be thrown if the same housekeeping parameter exists already at another index. A deep copy of the Housekeeping Data container will be made.
Definition at line 377 of file GCOMHkds.cpp.
References G_SET2, get_index(), m_hkds, GCOMHkd::name(), and gammalib::str().
|
inlinevirtual |
Return number of Housekeeping parameters in collection.
Returns the number of Housekeeping parameters in the collection.
Implements GContainer.
Definition at line 151 of file GCOMHkds.hpp.
References m_hkds.
Referenced by append(), at(), extend(), get_index(), insert(), GCOMObservation::load(), print(), remove(), and set().
|
protected |
Housekeeping Data containers.
Definition at line 95 of file GCOMHkds.hpp.
Referenced by append(), at(), copy_members(), extend(), get_index(), init_members(), insert(), is_empty(), operator[](), remove(), reserve(), set(), and size().