GammaLib
2.1.0.dev
|
COMPTEL Housekeeping Data container class. More...
#include <GCOMHkd.hpp>
Public Member Functions | |
GCOMHkd (void) | |
Void constructor. More... | |
GCOMHkd (const std::string &name) | |
Name constructor. More... | |
GCOMHkd (const GCOMHkd &hkd) | |
Copy constructor. More... | |
virtual | ~GCOMHkd (void) |
Destructor. More... | |
GCOMHkd & | operator= (const GCOMHkd &hkd) |
Assignment operator. More... | |
void | clear (void) |
Clear Housekeeping Data container. More... | |
GCOMHkd * | clone (void) const |
Clone Housekeeping Data container. More... | |
std::string | classname (void) const |
Return class name. More... | |
int | size (void) const |
Return number of Housekeeping Data in container. More... | |
bool | is_empty (void) const |
Signals if there are no Housekeeping Data in container. More... | |
void | append (const GTime &time, const double &value) |
Append Housekeeping Data to container. More... | |
void | remove (const int &index) |
Remove Housekeeping Data. More... | |
void | reserve (const int &num) |
Reserves space for Housekeeping Data in container. More... | |
void | extend (const GCOMHkd &hkd) |
Extend Housekeeping Data. More... | |
const std::string & | name (void) const |
Return Housekeeping Data name. More... | |
void | name (const std::string &name) |
Set Housekeeping Data name. More... | |
const GTime & | time (const int &index) const |
Return reference to Housekeeping Data time. More... | |
void | time (const int &index, const GTime &time) |
Set Housekeeping Data time. More... | |
const double & | value (const int &index) const |
Return reference to Housekeeping Data value. More... | |
void | value (const int &index, const double &value) |
Set Housekeeping Data value. More... | |
std::string | print (const GChatter &chatter=NORMAL) const |
Print Housekeeping Data container. 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 GCOMHkd &hkd) |
Copy class members. More... | |
void | free_members (void) |
Delete class members. More... | |
Protected Attributes | |
std::string | m_name |
Name of housekeeping parameter. More... | |
GTimes | m_times |
Times. More... | |
std::vector< double > | m_values |
Values at times. More... | |
COMPTEL Housekeeping Data container class.
This class holds data for one housekeeping parameter.
Definition at line 49 of file GCOMHkd.hpp.
GCOMHkd::GCOMHkd | ( | void | ) |
Void constructor.
Definition at line 61 of file GCOMHkd.cpp.
References init_members().
Referenced by clone().
|
explicit |
Name constructor.
[in] | name | Name of Housekeeping parameter |
Definition at line 76 of file GCOMHkd.cpp.
References init_members(), and name().
GCOMHkd::GCOMHkd | ( | const GCOMHkd & | hkd | ) |
Copy constructor.
[in] | hkd | Housekeeping Data container. |
Definition at line 94 of file GCOMHkd.cpp.
References copy_members(), and init_members().
|
virtual |
void GCOMHkd::append | ( | const GTime & | time, |
const double & | value | ||
) |
Append Housekeeping Data to container.
[in] | time | Time stamp of Housekeeping Data. |
[in] | value | Value of Housekeeping Data. |
Appends time stamp and corresponding value to Housekeeping Data container.
Definition at line 194 of file GCOMHkd.cpp.
References GTimes::append(), m_times, and m_values.
Referenced by GCOMHkds::read().
|
inlinevirtual |
Return class name.
Implements GBase.
Definition at line 98 of file GCOMHkd.hpp.
|
virtual |
Clear Housekeeping Data container.
Implements GBase.
Definition at line 162 of file GCOMHkd.cpp.
References free_members(), and init_members().
|
virtual |
Clone Housekeeping Data container.
Implements GBase.
Definition at line 180 of file GCOMHkd.cpp.
References GCOMHkd().
|
protected |
Copy class members.
[in] | hkd | Housekeeping Data container. |
Definition at line 475 of file GCOMHkd.cpp.
References m_name, m_times, and m_values.
Referenced by GCOMHkd(), and operator=().
void GCOMHkd::extend | ( | const GCOMHkd & | hkd | ) |
Extend Housekeeping Data.
[in] | hkd | Housekeeping Data container. |
GException::invalid_argument | Mismatch between housekeeping parameter names. |
Extend existing Housekeeping Data container with data found in another container by respecting the time ordering of the data.
Definition at line 243 of file GCOMHkd.cpp.
References GTimes::append(), G_EXTEND, GTimes::insert(), is_empty(), m_times, m_values, name(), reserve(), and size().
|
protected |
Delete class members.
Definition at line 490 of file GCOMHkd.cpp.
Referenced by clear(), operator=(), and ~GCOMHkd().
|
protected |
Initialise class members.
Definition at line 458 of file GCOMHkd.cpp.
References GTimes::clear(), m_name, m_times, and m_values.
Referenced by clear(), GCOMHkd(), and operator=().
|
inlinevirtual |
Signals if there are no Housekeeping Data in container.
Signals if the Housekeeping Data container does not contain any Housekeeping Data.
Implements GContainer.
Definition at line 127 of file GCOMHkd.hpp.
References GTimes::is_empty(), and m_times.
Referenced by extend().
|
inline |
Return Housekeeping Data name.
Returns the Housekeeping Data name.
Definition at line 157 of file GCOMHkd.hpp.
References m_name.
Referenced by extend(), GCOMHkd(), name(), and GCOMHkds::set().
|
inline |
Set Housekeeping Data name.
[in] | name | Housekeeping Data name. |
Sets the Housekeeping Data name.
Definition at line 171 of file GCOMHkd.hpp.
Assignment operator.
[in] | hkd | Housekeeping Data container. |
Definition at line 132 of file GCOMHkd.cpp.
References copy_members(), free_members(), and init_members().
Print Housekeeping Data container.
[in] | chatter | Chattiness. |
Implements GBase.
Definition at line 403 of file GCOMHkd.cpp.
References GTimes::append(), gammalib::com_tics(), gammalib::com_tjd(), m_name, m_times, GTime::mjd(), gammalib::parformat(), SILENT, size(), gammalib::str(), and GTime::utc().
|
virtual |
Remove Housekeeping Data.
[in] | index | Housekeeping Data index [0,...,size()[. |
Removes Housekeeping Data at index
from the container. All data after the specified index
are moved forward by one position.
Implements GContainer.
Definition at line 213 of file GCOMHkd.cpp.
References G_REMOVE, m_times, m_values, GTimes::remove(), and size().
|
inlinevirtual |
Reserves space for Housekeeping Data in container.
[in] | num | Number of Housekeeping Data. |
Reserves space for num
Housekeeping Data in the container.
Implements GContainer.
Definition at line 141 of file GCOMHkd.hpp.
References m_times, m_values, and GTimes::reserve().
Referenced by extend().
|
inlinevirtual |
Return number of Housekeeping Data in container.
Returns the number of Housekeeping Data in the container.
Implements GContainer.
Definition at line 112 of file GCOMHkd.hpp.
References m_times, and GTimes::size().
Referenced by extend(), print(), remove(), time(), value(), and GCOMDris::vetorate_setup().
const GTime & GCOMHkd::time | ( | const int & | index | ) | const |
Return reference to Housekeeping Data time.
[in] | index | Housekeeping Data index [0,...,size()-1]. |
GException::out_of_range | Housekeeping Data index is out of range. |
Returns a reference to the Housekeeping Data time with the specified index
.
Definition at line 304 of file GCOMHkd.cpp.
References G_TIME_GET, m_times, and size().
Referenced by time(), and GCOMDris::vetorate_setup().
void GCOMHkd::time | ( | const int & | index, |
const GTime & | time | ||
) |
Set Housekeeping Data time.
[in] | index | Housekeeping Data index [0,...,size()-1]. |
[in] | time | Housekeeping Data time. |
GException::out_of_range | Housekeeping Data index is out of range. |
Sets the Housekeeping Data time with the specified index
.
Definition at line 328 of file GCOMHkd.cpp.
References G_TIME_SET, m_times, size(), and time().
const double & GCOMHkd::value | ( | const int & | index | ) | const |
Return reference to Housekeeping Data value.
[in] | index | Housekeeping Data index [0,...,size()-1]. |
GException::out_of_range | Housekeeping Data index is out of range. |
Returns a reference to the Housekeeping Data value with the specified index
.
Definition at line 356 of file GCOMHkd.cpp.
References G_VALUE_GET, m_values, and size().
Referenced by value(), and GCOMDris::vetorate_setup().
void GCOMHkd::value | ( | const int & | index, |
const double & | value | ||
) |
Set Housekeeping Data value.
[in] | index | Housekeeping Data index [0,...,size()-1]. |
[in] | value | Housekeeping Data value. |
GException::out_of_range | Housekeeping Data index is out of range. |
Sets the Housekeeping Data value with the specified index
.
Definition at line 380 of file GCOMHkd.cpp.
References G_VALUE_SET, m_values, size(), and value().
|
protected |
Name of housekeeping parameter.
Definition at line 86 of file GCOMHkd.hpp.
Referenced by copy_members(), init_members(), name(), and print().
|
protected |
Times.
Definition at line 87 of file GCOMHkd.hpp.
Referenced by append(), copy_members(), extend(), init_members(), is_empty(), print(), remove(), reserve(), size(), and time().
|
protected |
Values at times.
Definition at line 88 of file GCOMHkd.hpp.
Referenced by append(), copy_members(), extend(), init_members(), remove(), reserve(), and value().