Commit 88262b0fff91c96c08a4404c1fa15101e7340df0

Authored by Jürgen Knödlseder
1 parent b10f23df

Remove old template classes

src/template/GClass.cpp deleted
1   -/***************************************************************************
2   - * GClass.cpp - [brief descriptor] *
3   - * ----------------------------------------------------------------------- *
4   - * copyright (C) 2010-20xx by [author] *
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 GClass.cpp
23   - * @brief [brief descriptor]
24   - * @author [author]
25   - */
26   -
27   -/* __ Includes ___________________________________________________________ */
28   -#ifdef HAVE_CONFIG_H
29   -#include <config.h>
30   -#endif
31   -#include "GClass.hpp"
32   -#include "GTools.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   - ***************************************************************************/
52   -GClass::GClass(void)
53   -{
54   - // Initialise private members
55   - init_members();
56   -
57   - // Return
58   - return;
59   -}
60   -
61   -
62   -/***********************************************************************//**
63   - * @brief Copy constructor
64   - *
65   - * @param[in] c Object.
66   - ***************************************************************************/
67   -GClass::GClass(const GClass& c)
68   -{
69   - // Initialise private
70   - init_members();
71   -
72   - // Copy members
73   - copy_members(c);
74   -
75   - // Return
76   - return;
77   -}
78   -
79   -
80   -/***********************************************************************//**
81   - * @brief Destructor
82   - ***************************************************************************/
83   -GClass::~GClass(void)
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] c Object.
103   - ***************************************************************************/
104   -GClass& GClass::operator= (const GClass& c)
105   -{
106   - // Execute only if object is not identical
107   - if (this != &c) {
108   -
109   - // Free members
110   - free_members();
111   -
112   - // Initialise private members for clean destruction
113   - init_members();
114   -
115   - // Copy members
116   - copy_members(c);
117   -
118   - } // endif: object was not identical
119   -
120   - // Return
121   - return *this;
122   -}
123   -
124   -
125   -/*==========================================================================
126   - = =
127   - = Public methods =
128   - = =
129   - ==========================================================================*/
130   -
131   -/***********************************************************************//**
132   - * @brief Clear instance
133   - *
134   - * This method properly resets the object to an initial state.
135   - ***************************************************************************/
136   -void GClass::clear(void)
137   -{
138   - // Free class members
139   - free_members();
140   -
141   - // Initialise members
142   - init_members();
143   -
144   - // Return
145   - return;
146   -}
147   -
148   -
149   -/***********************************************************************//**
150   - * @brief Clone instance
151   - **************************************************************************/
152   -GClass* GClass::clone(void) const
153   -{
154   - return new GClass(*this);
155   -}
156   -
157   -
158   -/***********************************************************************//**
159   - * @brief Print class information
160   - ***************************************************************************/
161   -std::string GClass::print(const GChatter& chatter) const
162   -{
163   - // Initialise result string
164   - std::string result;
165   -
166   - // Append header
167   - result.append("=== GClass ===");
168   - result.append("\n"+gammalib::parformat("Name")+m_name);
169   -
170   - // Return result
171   - return result;
172   -}
173   -
174   -
175   -/*==========================================================================
176   - = =
177   - = Private methods =
178   - = =
179   - ==========================================================================*/
180   -
181   -/***********************************************************************//**
182   - * @brief Initialise class members
183   - ***************************************************************************/
184   -void GClass::init_members(void)
185   -{
186   - // Initialise members
187   - m_name.clear();
188   -
189   - // Return
190   - return;
191   -}
192   -
193   -
194   -/***********************************************************************//**
195   - * @brief Copy class members
196   - *
197   - * @param[in] c Object.
198   - ***************************************************************************/
199   -void GClass::copy_members(const GClass& c)
200   -{
201   - // Copy attributes
202   - m_name = c.m_name;
203   -
204   - // Return
205   - return;
206   -}
207   -
208   -
209   -/***********************************************************************//**
210   - * @brief Delete class members
211   - ***************************************************************************/
212   -void GClass::free_members(void)
213   -{
214   - // Free memory
215   - //if (m_par = NULL) delete [] m_par;
216   -
217   - // Signal free pointers
218   - //m_par = NULL;
219   -
220   - // Return
221   - return;
222   -}
src/template/GClass.hpp deleted
1   -/***************************************************************************
2   - * GClass.hpp - [brief descriptor] *
3   - * ----------------------------------------------------------------------- *
4   - * copyright (C) 2010-20xx by [author] *
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 GClass.hpp
23   - * @brief [brief descriptor]
24   - * @author [author]
25   - */
26   -
27   -#ifndef GCLASS_HPP
28   -#define GCLASS_HPP
29   -
30   -/* __ Includes ___________________________________________________________ */
31   -#include <string>
32   -#include "GBase.hpp"
33   -
34   -
35   -/***********************************************************************//**
36   - * @class GClass
37   - *
38   - * @brief [brief descriptor] interface definition
39   - ***************************************************************************/
40   -class GClass : public GBase {
41   -
42   -public:
43   - // Constructors and destructors
44   - GClass(void);
45   - GClass(const GClass& c);
46   - virtual ~GClass(void);
47   -
48   - // Operators
49   - GClass& operator= (const GClass& c);
50   -
51   - // Methods
52   - void clear(void);
53   - GClass* clone(void) const;
54   - std::string print(const GChatter& chatter = NORMAL) const;
55   -
56   -protected:
57   - // Protected methods
58   - void init_members(void);
59   - void copy_members(const GClass& c);
60   - void free_members(void);
61   -
62   - // Protected data members
63   - std::string m_name; //!< Name
64   -};
65   -
66   -#endif /* GCLASS_HPP */
src/template/test_GClass.cpp deleted
1   -#include <iostream>
2   -#include "GammaLib.hpp"
3   -#include "GClass.hpp"
4   -
5   -int main(void) {
6   - GClass a;
7   - std::cout << a << std::endl;
8   - return 0;
9   -}