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

COMPTEL instrument status class. More...

#include <GCOMStatus.hpp>

Inheritance diagram for GCOMStatus:
GBase

Public Member Functions

 GCOMStatus (void)
 Void constructor. More...
 
 GCOMStatus (const GCOMStatus &status)
 Copy constructor. More...
 
virtual ~GCOMStatus (void)
 Destructor. More...
 
GCOMStatusoperator= (const GCOMStatus &status)
 Assignment operator. More...
 
virtual void clear (void)
 Clear COMPTEL instrument status. More...
 
virtual GCOMStatusclone (void) const
 Clone COMPTEL instrument status. More...
 
virtual std::string classname (void) const
 Return class name. More...
 
virtual std::string print (const GChatter &chatter=NORMAL) const
 Print COMPTEL instrument status. More...
 
void load (void) const
 Load COMPTEL instrument status database. More...
 
int d1status (const int &tjd, const int &module) const
 Return D1 module status. More...
 
int d2status (const int &tjd, const int &module) const
 Return D2 module status. 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 GCOMStatus &status)
 Copy class members. More...
 
void free_members (void)
 Delete class members. More...
 
void update_cache (const int &tjd) const
 Update module status cache. More...
 
void load_status (void) const
 Load status information from database. More...
 

Protected Attributes

std::vector< int > m_tjds
 TJD for status. More...
 
std::vector< std::vector< int > > m_d1status
 D1 module status. More...
 
std::vector< std::vector< int > > m_d2status
 D2 module status. More...
 
int m_last_tjd
 Last TJD. More...
 
std::vector< int > m_last_d1status
 Last D1 module status. More...
 
std::vector< int > m_last_d2status
 Last D2 module status. More...
 

Detailed Description

COMPTEL instrument status class.

The class implements a database of the COMPTEL instrument status. For the time being the database contains the status of the D1 and D2 modules for all days that are covered by the CGRO mission.

Definition at line 49 of file GCOMStatus.hpp.

Constructor & Destructor Documentation

GCOMStatus::GCOMStatus ( void  )

Void constructor.

Definition at line 61 of file GCOMStatus.cpp.

References init_members().

Referenced by clone().

GCOMStatus::GCOMStatus ( const GCOMStatus status)

Copy constructor.

Parameters
[in]statusCOMPTEL instrument status.

Definition at line 76 of file GCOMStatus.cpp.

References copy_members(), and init_members().

GCOMStatus::~GCOMStatus ( void  )
virtual

Destructor.

Definition at line 92 of file GCOMStatus.cpp.

References free_members().

Member Function Documentation

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

Return class name.

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

Implements GBase.

Definition at line 97 of file GCOMStatus.hpp.

void GCOMStatus::clear ( void  )
virtual

Clear COMPTEL instrument status.

Implements GBase.

Definition at line 144 of file GCOMStatus.cpp.

References free_members(), and init_members().

GCOMStatus * GCOMStatus::clone ( void  ) const
virtual

Clone COMPTEL instrument status.

Returns
Pointer to deep copy of COMPTEL instrument status.

Implements GBase.

Definition at line 162 of file GCOMStatus.cpp.

References GCOMStatus().

void GCOMStatus::copy_members ( const GCOMStatus status)
protected

Copy class members.

Parameters
[in]statusCOMPTEL instrument status.

Definition at line 310 of file GCOMStatus.cpp.

References m_d1status, m_d2status, m_last_d1status, m_last_d2status, m_last_tjd, and m_tjds.

Referenced by GCOMStatus(), and operator=().

int GCOMStatus::d1status ( const int &  tjd,
const int &  module 
) const

Return D1 module status.

Parameters
[in]tjdTJD for status inquiry.
[in]moduleD1 module number (1-7).
Returns
D1 module status.

Definition at line 188 of file GCOMStatus.cpp.

References G_D1STATUS, load_status(), m_last_d1status, m_tjds, gammalib::str(), and update_cache().

Referenced by GCOMDri::compute_dre(), GCOMDri::compute_geometry(), and load_status().

int GCOMStatus::d2status ( const int &  tjd,
const int &  module 
) const

Return D2 module status.

Parameters
[in]tjdTJD for status inquiry.
[in]moduleD2 module number (1-14).
Returns
D2 module status.

Definition at line 217 of file GCOMStatus.cpp.

References G_D2STATUS, load_status(), m_last_d2status, m_tjds, gammalib::str(), and update_cache().

Referenced by GCOMDri::compute_dre(), GCOMDri::compute_geometry(), and load_status().

void GCOMStatus::free_members ( void  )
protected

Delete class members.

Definition at line 330 of file GCOMStatus.cpp.

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

void GCOMStatus::init_members ( void  )
protected

Initialise class members.

Definition at line 288 of file GCOMStatus.cpp.

References m_d1status, m_d2status, m_last_d1status, m_last_d2status, m_last_tjd, and m_tjds.

Referenced by clear(), GCOMStatus(), and operator=().

void GCOMStatus::load ( void  ) const

Load COMPTEL instrument status database.

Definition at line 171 of file GCOMStatus.cpp.

References load_status().

void GCOMStatus::load_status ( void  ) const
protected

Load status information from database.

Loads the status information from the database.

Definition at line 383 of file GCOMStatus.cpp.

References GFits::close(), d1status(), d2status(), GCaldb::filename(), G_LOAD_STATUS, GFitsTableCol::integer(), GFilename::is_empty(), m_d1status, m_d2status, m_tjds, GFitsTable::nrows(), and GFits::table().

Referenced by d1status(), d2status(), and load().

GCOMStatus & GCOMStatus::operator= ( const GCOMStatus status)

Assignment operator.

Parameters
[in]statusCOMPTEL instrument status.
Returns
COMPTEL instrument status.

Definition at line 114 of file GCOMStatus.cpp.

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

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

Print COMPTEL instrument status.

Parameters
[in]chatterChattiness.
Returns
String containing COMPTEL instrument status information.

Implements GBase.

Definition at line 245 of file GCOMStatus.cpp.

References m_tjds, gammalib::parformat(), SILENT, and gammalib::str().

void GCOMStatus::update_cache ( const int &  tjd) const
protected

Update module status cache.

Parameters
[in]tjdTJD for status inquiry.

Definition at line 342 of file GCOMStatus.cpp.

References G_UPDATE_CACHE, m_d1status, m_d2status, m_last_d1status, m_last_d2status, m_last_tjd, m_tjds, and gammalib::str().

Referenced by d1status(), and d2status().

Member Data Documentation

std::vector<std::vector<int> > GCOMStatus::m_d1status
mutableprotected

D1 module status.

Definition at line 81 of file GCOMStatus.hpp.

Referenced by copy_members(), init_members(), load_status(), and update_cache().

std::vector<std::vector<int> > GCOMStatus::m_d2status
mutableprotected

D2 module status.

Definition at line 82 of file GCOMStatus.hpp.

Referenced by copy_members(), init_members(), load_status(), and update_cache().

std::vector<int> GCOMStatus::m_last_d1status
mutableprotected

Last D1 module status.

Definition at line 86 of file GCOMStatus.hpp.

Referenced by copy_members(), d1status(), init_members(), and update_cache().

std::vector<int> GCOMStatus::m_last_d2status
mutableprotected

Last D2 module status.

Definition at line 87 of file GCOMStatus.hpp.

Referenced by copy_members(), d2status(), init_members(), and update_cache().

int GCOMStatus::m_last_tjd
mutableprotected

Last TJD.

Definition at line 85 of file GCOMStatus.hpp.

Referenced by copy_members(), init_members(), and update_cache().

std::vector<int> GCOMStatus::m_tjds
mutableprotected

TJD for status.

Definition at line 80 of file GCOMStatus.hpp.

Referenced by copy_members(), d1status(), d2status(), init_members(), load_status(), print(), and update_cache().


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