GammaLib 2.0.0
Loading...
Searching...
No Matches
GCOMStatus.hpp
Go to the documentation of this file.
1/***************************************************************************
2 * GCOMStatus.hpp - COMPTEL instrument status class *
3 * ----------------------------------------------------------------------- *
4 * copyright (C) 2017 by Juergen Knoedlseder *
5 * ----------------------------------------------------------------------- *
6 * *
7 * This program is free software: you can redistribute it and/or modify *
8 * it under the terms of the GNU General Public License as published by *
9 * the Free Software Foundation, either version 3 of the License, or *
10 * (at your option) any later version. *
11 * *
12 * This program is distributed in the hope that it will be useful, *
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15 * GNU General Public License for more details. *
16 * *
17 * You should have received a copy of the GNU General Public License *
18 * along with this program. If not, see <http://www.gnu.org/licenses/>. *
19 * *
20 ***************************************************************************/
21/**
22 * @file GCOMStatus.hpp
23 * @brief COMPTEL instrument status class definition
24 * @author Juergen Knoedlseder
25 */
26
27#ifndef GCOMSTATUS_HPP
28#define GCOMSTATUS_HPP
29
30/* __ Includes ___________________________________________________________ */
31#include <string>
32#include <vector>
33#include "GBase.hpp"
34
35/* __ Forward declarations _______________________________________________ */
36
37/* __ Constants __________________________________________________________ */
38
39
40/***********************************************************************//**
41 * @class GCOMStatus
42 *
43 * @brief COMPTEL instrument status class
44 *
45 * The class implements a database of the COMPTEL instrument status. For the
46 * time being the database contains the status of the D1 and D2 modules for
47 * all days that are covered by the CGRO mission.
48 ***************************************************************************/
49class GCOMStatus : public GBase {
50
51public:
52 // Constructors and destructors
53 GCOMStatus(void);
54 GCOMStatus(const GCOMStatus& status);
55 virtual ~GCOMStatus(void);
56
57 // Operators
58 GCOMStatus& operator=(const GCOMStatus& status);
59
60 // Implemented pure virtual base class methods
61 virtual void clear(void);
62 virtual GCOMStatus* clone(void) const;
63 virtual std::string classname(void) const;
64 virtual std::string print(const GChatter& chatter = NORMAL) const;
65
66 // Other methods
67 void load(void) const;
68 int d1status(const int& tjd, const int& module) const;
69 int d2status(const int& tjd, const int& module) const;
70
71protected:
72 // Protected methods
73 void init_members(void);
74 void copy_members(const GCOMStatus& status);
75 void free_members(void);
76 void update_cache(const int& tjd) const;
77 void load_status(void) const;
78
79 // Protected members
80 mutable std::vector<int> m_tjds; //!< TJD for status
81 mutable std::vector<std::vector<int> > m_d1status; //!< D1 module status
82 mutable std::vector<std::vector<int> > m_d2status; //!< D2 module status
83
84 // Cache for last module status
85 mutable int m_last_tjd; //!< Last TJD
86 mutable std::vector<int> m_last_d1status; //!< Last D1 module status
87 mutable std::vector<int> m_last_d2status; //!< Last D2 module status
88};
89
90
91/***********************************************************************//**
92 * @brief Return class name
93 *
94 * @return String containing the class name ("GCOMStatus").
95 ***************************************************************************/
96inline
97std::string GCOMStatus::classname(void) const
98{
99 return ("GCOMStatus");
100}
101
102#endif /* GCOMSTATUS_HPP */
Definition of interface for all GammaLib classes.
GChatter
Definition GTypemaps.hpp:33
@ NORMAL
Definition GTypemaps.hpp:36
Interface class for all GammaLib classes.
Definition GBase.hpp:52
COMPTEL instrument status class.
std::vector< std::vector< int > > m_d1status
D1 module status.
GCOMStatus(void)
Void constructor.
std::vector< std::vector< int > > m_d2status
D2 module status.
virtual std::string classname(void) const
Return class name.
virtual GCOMStatus * clone(void) const
Clone COMPTEL instrument status.
int d2status(const int &tjd, const int &module) const
Return D2 module status.
std::vector< int > m_last_d1status
Last D1 module status.
int d1status(const int &tjd, const int &module) const
Return D1 module status.
void init_members(void)
Initialise class members.
void load(void) const
Load COMPTEL instrument status database.
virtual ~GCOMStatus(void)
Destructor.
std::vector< int > m_last_d2status
Last D2 module status.
void load_status(void) const
Load status information from database.
int m_last_tjd
Last TJD.
GCOMStatus & operator=(const GCOMStatus &status)
Assignment operator.
void free_members(void)
Delete class members.
void update_cache(const int &tjd) const
Update module status cache.
virtual std::string print(const GChatter &chatter=NORMAL) const
Print COMPTEL instrument status.
virtual void clear(void)
Clear COMPTEL instrument status.
std::vector< int > m_tjds
TJD for status.
void copy_members(const GCOMStatus &status)
Copy class members.