GammaLib  2.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GCTACubeSource.hpp
Go to the documentation of this file.
1 /***************************************************************************
2  * GCTACubeSource.hpp - Abstract CTA cube analysis source base class *
3  * ----------------------------------------------------------------------- *
4  * copyright (C) 2014-2015 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 GCTACubeSource.hpp
23  * @brief Abstract CTA cube analysis source base class definition
24  * @author Juergen Knoedlseder
25  */
26 
27 #ifndef GCTACUBESOURCE_HPP
28 #define GCTACUBESOURCE_HPP
29 
30 /* __ Includes ___________________________________________________________ */
31 #include <string>
32 #include "GBase.hpp"
33 #include "GCTATypemaps.hpp"
34 
35 /* __ Type definitions ___________________________________________________ */
36 
37 /* __ Forward declarations _______________________________________________ */
38 class GModelSpatial;
39 class GObservation;
40 
41 
42 /***********************************************************************//**
43  * @class GCTACubeSource
44  *
45  * @brief CTA source cube base class
46  *
47  * This class provides an abstract base class for handling of pre-computed
48  * response information in a cube-style analysis.
49  ***************************************************************************/
50 class GCTACubeSource : public GBase {
51 
52 public:
53  // Constructors and destructors
54  GCTACubeSource(void);
55  GCTACubeSource(const GCTACubeSource& source);
56  virtual ~GCTACubeSource(void);
57 
58  // Operators
59  virtual GCTACubeSource& operator=(const GCTACubeSource & source);
60 
61  // Pure virtual methods
62  virtual void clear(void) = 0;
63  virtual GCTACubeSource* clone(void) const = 0;
64  virtual std::string classname(void) const = 0;
65  virtual GCTAClassCode code(void) const = 0;
66  virtual void set(const std::string& name,
67  const GModelSpatial& model,
68  const GObservation& obs) = 0;
69  virtual std::string print(const GChatter& chatter = NORMAL) const = 0;
70 
71  // Implemented methods
72  virtual const std::string& name(void) const;
73  virtual void name(const std::string& name);
74 
75 protected:
76  // Protected methods
77  void init_members(void);
78  void copy_members(const GCTACubeSource& source);
79  void free_members(void);
80 
81  // Data members
82  std::string m_name; //!< Unique source name
83 };
84 
85 
86 
87 /***********************************************************************//**
88  * @brief Return the source name
89  *
90  * @return Source name.
91  ***************************************************************************/
92 inline
93 const std::string& GCTACubeSource::name(void) const
94 {
95  return (m_name);
96 }
97 
98 
99 /***********************************************************************//**
100  * @brief Set the source name
101  *
102  * @param[in] name Source name.
103  ***************************************************************************/
104 inline
105 void GCTACubeSource::name(const std::string& name)
106 {
107  m_name = name;
108  return;
109 }
110 
111 #endif /* GCTASOURCECUBE_HPP */
virtual GCTAClassCode code(void) const =0
virtual const std::string & name(void) const
Return the source name.
void init_members(void)
Initialise class members.
Definition of GammaLib CTA typemaps.
void copy_members(const GCTACubeSource &source)
Copy class members.
GCTAClassCode
Definition of interface for all GammaLib classes.
virtual ~GCTACubeSource(void)
Destructor.
virtual std::string classname(void) const =0
Return class name.
CTA source cube base class.
virtual void set(const std::string &name, const GModelSpatial &model, const GObservation &obs)=0
virtual GCTACubeSource & operator=(const GCTACubeSource &source)
Assignment operator.
virtual std::string print(const GChatter &chatter=NORMAL) const =0
Print content of object.
Interface class for all GammaLib classes.
Definition: GBase.hpp:52
virtual GCTACubeSource * clone(void) const =0
Clones object.
GCTACubeSource(void)
Void constructor.
GChatter
Definition: GTypemaps.hpp:33
Abstract observation base class.
std::string m_name
Unique source name.
void free_members(void)
Delete class members.
Abstract spatial model base class.
virtual void clear(void)=0
Clear object.