GammaLib  2.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GEvent.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  * GEvent.cpp - Abstract event base class *
3  * ----------------------------------------------------------------------- *
4  * copyright (C) 2009-2013 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 GEvent.cpp
23  * @brief Abstract event base class implementation
24  * @author Juergen Knoedlseder
25  */
26 
27 /* __ Includes ___________________________________________________________ */
28 #ifdef HAVE_CONFIG_H
29 #include <config.h>
30 #endif
31 #include "GException.hpp"
32 #include "GEvent.hpp"
33 
34 /* __ Method name definitions ____________________________________________ */
35 
36 /* __ Macros _____________________________________________________________ */
37 
38 /* __ Coding definitions _________________________________________________ */
39 
40 /* __ Debug definitions __________________________________________________ */
41 
42 
43 /*==========================================================================
44  = =
45  = Constructors/destructors =
46  = =
47  ==========================================================================*/
48 
49 /***********************************************************************//**
50  * @brief Void constructor
51  ***************************************************************************/
53 {
54  // Initialise class members for clean destruction
55  init_members();
56 
57  // Return
58  return;
59 }
60 
61 
62 /***********************************************************************//**
63  * @brief Copy constructor
64  *
65  * @param[in] event Event.
66  ***************************************************************************/
67 GEvent::GEvent(const GEvent& event)
68 {
69  // Initialise class members for clean destruction
70  init_members();
71 
72  // Copy members
73  copy_members(event);
74 
75  // Return
76  return;
77 }
78 
79 
80 /***********************************************************************//**
81  * @brief Destructor
82  ***************************************************************************/
84 {
85  // Free members
86  free_members();
87 
88  // Return
89  return;
90 }
91 
92 
93 /*==========================================================================
94  = =
95  = Operators =
96  = =
97  ==========================================================================*/
98 
99 /***********************************************************************//**
100  * @brief Assignment operator
101  *
102  * @param[in] event Event.
103  * @return Event.
104  ***************************************************************************/
106 {
107  // Execute only if object is not identical
108  if (this != &event) {
109 
110  // Free members
111  free_members();
112 
113  // Initialise private members for clean destruction
114  init_members();
115 
116  // Copy members
117  copy_members(event);
118 
119  } // endif: object was not identical
120 
121  // Return this object
122  return *this;
123 }
124 
125 
126 /*==========================================================================
127  = =
128  = Public methods =
129  = =
130  ==========================================================================*/
131 
132 /*==========================================================================
133  = =
134  = Private methods =
135  = =
136  ==========================================================================*/
137 
138 /***********************************************************************//**
139  * @brief Initialise class members
140  ***************************************************************************/
142 {
143  // Return
144  return;
145 }
146 
147 
148 /***********************************************************************//**
149  * @brief Copy class members
150  *
151  * @param[in] event GEvent members which should be copied.
152  ***************************************************************************/
153 void GEvent::copy_members(const GEvent& event)
154 {
155  // Return
156  return;
157 }
158 
159 
160 /***********************************************************************//**
161  * @brief Delete class members
162  ***************************************************************************/
164 {
165  // Return
166  return;
167 }
void copy_members(const GEvent &event)
Copy class members.
Definition: GEvent.cpp:153
Abstract interface for the event classes.
Definition: GEvent.hpp:71
virtual GEvent & operator=(const GEvent &event)
Assignment operator.
Definition: GEvent.cpp:105
virtual ~GEvent(void)
Destructor.
Definition: GEvent.cpp:83
Abstract event base class definition.
void init_members(void)
Initialise class members.
Definition: GEvent.cpp:141
void free_members(void)
Delete class members.
Definition: GEvent.cpp:163
Exception handler interface definition.
GEvent(void)
Void constructor.
Definition: GEvent.cpp:52