GammaLib 2.0.0
Loading...
Searching...
No Matches
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 _______________________________________________ */
36class 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 ***************************************************************************/
46class GEventCube : public GEvents {
47
48public:
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
74protected:
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 ***************************************************************************/
87inline
89{
90 return;
91}
92
93
94/***********************************************************************//**
95 * @brief Set times (dummy method)
96 ***************************************************************************/
97inline
99{
100 return;
101}
102
103#endif /* GEVENTCUBE_HPP */
Abstract event bin base class definition.
Abstract event container class interface definition.
GChatter
Definition GTypemaps.hpp:33
@ NORMAL
Definition GTypemaps.hpp:36
Abstract interface for the event bin class.
Definition GEventBin.hpp:64
Abstract event bin container class.
virtual std::string classname(void) const =0
Return class name.
virtual void write(GFits &file) const =0
virtual ~GEventCube(void)
Destructor.
virtual void save(const GFilename &filename, const bool &clobber=false) const =0
virtual GEventBin * operator[](const int &index)=0
virtual const GEventBin * operator[](const int &index) const =0
virtual void load(const GFilename &filename)=0
virtual GEventCube * clone(void) const =0
Clones object.
virtual int size(void) const =0
virtual int naxis(const int &axis) const =0
GEventCube(void)
Void constructor.
virtual std::string print(const GChatter &chatter=NORMAL) const =0
Print content of object.
void free_members(void)
Delete class members.
virtual int number(void) const =0
virtual void clear(void)=0
Clear object.
void copy_members(const GEventCube &cube)
Copy class members.
virtual void read(const GFits &file)=0
virtual void set_times(void)
Set times (dummy method)
void init_members(void)
Initialise class members.
virtual GEventCube & operator=(const GEventCube &cube)
Assignment operator.
virtual void set_energies(void)
Set energies (dummy method)
virtual int dim(void) const =0
Abstract event container class.
Definition GEvents.hpp:66
Filename class.
Definition GFilename.hpp:62
FITS file class.
Definition GFits.hpp:63