GammaLib  1.7.0.dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GMWLInstDir.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  * GMWLInstDir.cpp - Multi-wavelength instrument direction class *
3  * ----------------------------------------------------------------------- *
4  * copyright (C) 2010-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 GMWLInstDir.cpp
23  * @brief Instrument direction class implementation
24  * @author Juergen Knoedlseder
25  */
26 
27 /* __ Includes ___________________________________________________________ */
28 #ifdef HAVE_CONFIG_H
29 #include <config.h>
30 #endif
31 #include "GMWLInstDir.hpp"
32 
33 /* __ Method name definitions ____________________________________________ */
34 
35 /* __ Macros _____________________________________________________________ */
36 
37 /* __ Coding definitions _________________________________________________ */
38 
39 /* __ Debug definitions __________________________________________________ */
40 
41 /* __ Prototypes _________________________________________________________ */
42 
43 /*==========================================================================
44  = =
45  = Constructors/destructors =
46  = =
47  ==========================================================================*/
48 
49 /***********************************************************************//**
50  * @brief Void constructor
51  ***************************************************************************/
53 {
54  // Initialise class members
55  init_members();
56 
57  // Return
58  return;
59 }
60 
61 
62 /***********************************************************************//**
63  * @brief Copy constructor
64  *
65  * @param[in] dir Instrument direction.
66  ***************************************************************************/
68 {
69  // Initialise class members
70  init_members();
71 
72  // Copy members
73  copy_members(dir);
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] dir Instrument direction.
103  ***************************************************************************/
105 {
106  // Execute only if object is not identical
107  if (this != &dir) {
108 
109  // Copy base class members
110  this->GInstDir::operator=(dir);
111 
112  // Free members
113  free_members();
114 
115  // Initialise private members
116  init_members();
117 
118  // Copy members
119  copy_members(dir);
120 
121  } // endif: object was not identical
122 
123  // Return this object
124  return *this;
125 }
126 
127 
128 /*==========================================================================
129  = =
130  = Public methods =
131  = =
132  ==========================================================================*/
133 
134 /***********************************************************************//**
135  * @brief Clear instance
136  ***************************************************************************/
138 {
139  // Free members
140  free_members();
141  this->GInstDir::free_members();
142 
143  // Initialise private members
144  this->GInstDir::init_members();
145  init_members();
146 
147  // Return
148  return;
149 }
150 
151 
152 /***********************************************************************//**
153  * @brief Clone instance
154  ***************************************************************************/
156 {
157  return new GMWLInstDir(*this);
158 }
159 
160 
161 /***********************************************************************//**
162  * @brief Print instrument direction information
163  *
164  * @param[in] chatter Chattiness (defaults to NORMAL).
165  * @return String containing instrument direction information.
166  ***************************************************************************/
167 std::string GMWLInstDir::print(const GChatter& chatter) const
168 {
169  // Initialise result string
170  std::string result;
171 
172  // Continue only if chatter is not silent
173  if (chatter != SILENT) {
174 
175  // Append header
176  result.append("GMWLInstDir(dummy)");
177 
178  } // endif: chatter was not silent
179 
180  // Return result
181  return result;
182 }
183 
184 
185 /*==========================================================================
186  = =
187  = Private methods =
188  = =
189  ==========================================================================*/
190 
191 /***********************************************************************//**
192  * @brief Initialise class members
193  ***************************************************************************/
195 {
196  // Return
197  return;
198 }
199 
200 
201 /***********************************************************************//**
202  * @brief Copy class members
203  *
204  * @param[in] dir Instrument direction.
205  ***************************************************************************/
207 {
208  // Return
209  return;
210 }
211 
212 
213 /***********************************************************************//**
214  * @brief Delete class members
215  ***************************************************************************/
217 {
218  // Return
219  return;
220 }
GMWLInstDir class definition.
GMWLInstDir * clone(void) const
Clone instance.
virtual GInstDir & operator=(const GInstDir &dir)
Assignment operator.
Definition: GInstDir.cpp:105
void free_members(void)
Delete class members.
Definition: GInstDir.cpp:163
void copy_members(const GMWLInstDir &dir)
Copy class members.
Abstract instrument direction base class.
Definition: GInstDir.hpp:47
void init_members(void)
Initialise class members.
virtual ~GMWLInstDir(void)
Destructor.
Definition: GMWLInstDir.cpp:83
GMWLInstDir(void)
Void constructor.
Definition: GMWLInstDir.cpp:52
GChatter
Definition: GTypemaps.hpp:33
Interface for the Multi-wavelength instrument direction class.
Definition: GMWLInstDir.hpp:44
void init_members(void)
Initialise class members.
Definition: GInstDir.cpp:141
void free_members(void)
Delete class members.
GMWLInstDir & operator=(const GMWLInstDir &dir)
Assignment operator.
std::string print(const GChatter &chatter=NORMAL) const
Print instrument direction information.
void clear(void)
Clear instance.