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