GammaLib  2.1.0.dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GCOMHkd Class Reference

COMPTEL Housekeeping Data container class. More...

#include <GCOMHkd.hpp>

Inheritance diagram for GCOMHkd:
GContainer GBase

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...
 
GCOMHkdoperator= (const GCOMHkd &hkd)
 Assignment operator. More...
 
void clear (void)
 Clear Housekeeping Data container. More...
 
GCOMHkdclone (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 GTimetime (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...
 

Detailed Description

COMPTEL Housekeeping Data container class.

This class holds data for one housekeeping parameter.

Definition at line 49 of file GCOMHkd.hpp.

Constructor & Destructor Documentation

GCOMHkd::GCOMHkd ( void  )

Void constructor.

Definition at line 61 of file GCOMHkd.cpp.

References init_members().

Referenced by clone().

GCOMHkd::GCOMHkd ( const std::string &  name)
explicit

Name constructor.

Parameters
[in]nameName of Housekeeping parameter

Definition at line 76 of file GCOMHkd.cpp.

References init_members(), and name().

GCOMHkd::GCOMHkd ( const GCOMHkd hkd)

Copy constructor.

Parameters
[in]hkdHousekeeping Data container.

Definition at line 94 of file GCOMHkd.cpp.

References copy_members(), and init_members().

GCOMHkd::~GCOMHkd ( void  )
virtual

Destructor.

Definition at line 110 of file GCOMHkd.cpp.

References free_members().

Member Function Documentation

void GCOMHkd::append ( const GTime time,
const double &  value 
)

Append Housekeeping Data to container.

Parameters
[in]timeTime stamp of Housekeeping Data.
[in]valueValue 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().

std::string GCOMHkd::classname ( void  ) const
inlinevirtual

Return class name.

Returns
String containing the class name ("GCOMHkd").

Implements GBase.

Definition at line 98 of file GCOMHkd.hpp.

void GCOMHkd::clear ( void  )
virtual

Clear Housekeeping Data container.

Implements GBase.

Definition at line 162 of file GCOMHkd.cpp.

References free_members(), and init_members().

GCOMHkd * GCOMHkd::clone ( void  ) const
virtual

Clone Housekeeping Data container.

Returns
Pointer to deep copy of Housekeeping Data container.

Implements GBase.

Definition at line 180 of file GCOMHkd.cpp.

References GCOMHkd().

void GCOMHkd::copy_members ( const GCOMHkd hkd)
protected

Copy class members.

Parameters
[in]hkdHousekeeping 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.

Parameters
[in]hkdHousekeeping Data container.
Exceptions
GException::invalid_argumentMismatch 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().

void GCOMHkd::free_members ( void  )
protected

Delete class members.

Definition at line 490 of file GCOMHkd.cpp.

Referenced by clear(), operator=(), and ~GCOMHkd().

void GCOMHkd::init_members ( void  )
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=().

bool GCOMHkd::is_empty ( void  ) const
inlinevirtual

Signals if there are no Housekeeping Data in container.

Returns
True if container is empty, false otherwise.

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().

const std::string & GCOMHkd::name ( void  ) const
inline

Return Housekeeping Data name.

Returns
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().

void GCOMHkd::name ( const std::string &  name)
inline

Set Housekeeping Data name.

Parameters
[in]nameHousekeeping Data name.

Sets the Housekeeping Data name.

Definition at line 171 of file GCOMHkd.hpp.

References m_name, and name().

GCOMHkd & GCOMHkd::operator= ( const GCOMHkd hkd)

Assignment operator.

Parameters
[in]hkdHousekeeping Data container.
Returns
Housekeeping Data container.

Definition at line 132 of file GCOMHkd.cpp.

References copy_members(), free_members(), and init_members().

std::string GCOMHkd::print ( const GChatter chatter = NORMAL) const
virtual

Print Housekeeping Data container.

Parameters
[in]chatterChattiness.
Returns
String containing Housekeeping Data container information.

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().

void GCOMHkd::remove ( const int &  index)
virtual

Remove Housekeeping Data.

Parameters
[in]indexHousekeeping 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().

void GCOMHkd::reserve ( const int &  num)
inlinevirtual

Reserves space for Housekeeping Data in container.

Parameters
[in]numNumber 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().

int GCOMHkd::size ( void  ) const
inlinevirtual

Return number of Housekeeping Data in container.

Returns
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.

Parameters
[in]indexHousekeeping Data index [0,...,size()-1].
Returns
Reference to Housekeeping Data time.
Exceptions
GException::out_of_rangeHousekeeping 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.

Parameters
[in]indexHousekeeping Data index [0,...,size()-1].
[in]timeHousekeeping Data time.
Exceptions
GException::out_of_rangeHousekeeping 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.

Parameters
[in]indexHousekeeping Data index [0,...,size()-1].
Returns
Reference to Housekeeping Data value.
Exceptions
GException::out_of_rangeHousekeeping 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.

Parameters
[in]indexHousekeeping Data index [0,...,size()-1].
[in]valueHousekeeping Data value.
Exceptions
GException::out_of_rangeHousekeeping 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().

Member Data Documentation

std::string GCOMHkd::m_name
protected

Name of housekeeping parameter.

Definition at line 86 of file GCOMHkd.hpp.

Referenced by copy_members(), init_members(), name(), and print().

GTimes GCOMHkd::m_times
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().

std::vector<double> GCOMHkd::m_values
protected

Values at times.

Definition at line 88 of file GCOMHkd.hpp.

Referenced by append(), copy_members(), extend(), init_members(), remove(), reserve(), and value().


The documentation for this class was generated from the following files: