GammaLib  2.1.0.dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GEventCube.hpp
Go to the documentation of this file.
1 /***************************************************************************
2  * GEventCube.hpp - Abstract event bin container class *
3  * ----------------------------------------------------------------------- *
4  * copyright (C) 2009-2016 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 GEventCube.hpp
23  * @brief Abstract event bin container class interface definition
24  * @author Juergen Knoedlseder
25  */
26 
27 #ifndef GEVENTCUBE_HPP
28 #define GEVENTCUBE_HPP
29 
30 /* __ Includes ___________________________________________________________ */
31 #include <string>
32 #include "GEvents.hpp"
33 #include "GEventBin.hpp"
34 
35 /* __ Forward declarations _______________________________________________ */
36 class GFilename;
37 
38 
39 /***********************************************************************//**
40  * @class GEventCube
41  *
42  * @brief Abstract event bin container class
43  *
44  * This class is an abstract container class for event bins.
45  ***************************************************************************/
46 class GEventCube : public GEvents {
47 
48 public:
49  // Constructors and destructors
50  GEventCube(void);
51  GEventCube(const GEventCube& cube);
52  virtual ~GEventCube(void);
53 
54  // Operators
55  virtual GEventCube& operator=(const GEventCube& cube);
56  virtual GEventBin* operator[](const int& index) = 0;
57  virtual const GEventBin* operator[](const int& index) const = 0;
58 
59  // Pure virtual methods
60  virtual void clear(void) = 0;
61  virtual GEventCube* clone(void) const = 0;
62  virtual std::string classname(void) const = 0;
63  virtual int size(void) const = 0;
64  virtual int dim(void) const = 0;
65  virtual int naxis(const int& axis) const = 0;
66  virtual void load(const GFilename& filename) = 0;
67  virtual void save(const GFilename& filename,
68  const bool& clobber = false) const = 0;
69  virtual void read(const GFits& file) = 0;
70  virtual void write(GFits& file) const = 0;
71  virtual int number(void) const = 0;
72  virtual std::string print(const GChatter& chatter = NORMAL) const = 0;
73 
74 protected:
75  // Protected methods
76  void init_members(void);
77  void copy_members(const GEventCube& cube);
78  void free_members(void);
79  virtual void set_energies(void);
80  virtual void set_times(void);
81 };
82 
83 
84 /***********************************************************************//**
85  * @brief Set energies (dummy method)
86  ***************************************************************************/
87 inline
89 {
90  return;
91 }
92 
93 
94 /***********************************************************************//**
95  * @brief Set times (dummy method)
96  ***************************************************************************/
97 inline
99 {
100  return;
101 }
102 
103 #endif /* GEVENTCUBE_HPP */
void init_members(void)
Initialise class members.
Definition: GEventCube.cpp:143
virtual int number(void) const =0
void free_members(void)
Delete class members.
Definition: GEventCube.cpp:165
Abstract interface for the event bin class.
Definition: GEventBin.hpp:64
virtual GEventCube & operator=(const GEventCube &cube)
Assignment operator.
Definition: GEventCube.cpp:104
Abstract event bin base class definition.
virtual void read(const GFits &file)=0
virtual GEventCube * clone(void) const =0
Clones object.
virtual std::string classname(void) const =0
Return class name.
FITS file class.
Definition: GFits.hpp:63
virtual int dim(void) const =0
virtual void clear(void)=0
Clear object.
virtual void save(const GFilename &filename, const bool &clobber=false) const =0
virtual int size(void) const =0
virtual void set_energies(void)
Set energies (dummy method)
Definition: GEventCube.hpp:88
Filename class.
Definition: GFilename.hpp:62
virtual ~GEventCube(void)
Destructor.
Definition: GEventCube.cpp:82
virtual int naxis(const int &axis) const =0
GChatter
Definition: GTypemaps.hpp:33
virtual GEventBin * operator[](const int &index)=0
Abstract event container class.
Definition: GEvents.hpp:66
virtual void set_times(void)
Set times (dummy method)
Definition: GEventCube.hpp:98
GEventCube(void)
Void constructor.
Definition: GEventCube.cpp:51
virtual void load(const GFilename &filename)=0
virtual void write(GFits &file) const =0
virtual std::string print(const GChatter &chatter=NORMAL) const =0
Print content of object.
Abstract event container class interface definition.
Abstract event bin container class.
Definition: GEventCube.hpp:46
void copy_members(const GEventCube &cube)
Copy class members.
Definition: GEventCube.cpp:155