Commit d85ed59922d77d066fa23702d260f46724c26f53

Authored by Jürgen Knödlseder
2 parents 47a0e1a2 de4845c2

Merge branch 'fix_GClass' into integration

Conflicts:
	doc/source/coding/coding.rst
.gitignore
... ... @@ -68,12 +68,15 @@ config.sub
68 68 configure
69 69 test-driver
70 70 src/gammalib-setup
  71 +src/template/test_GClass
71 72 doc/Doxyfile.bak
  73 +
72 74 test/test_url.dat
73 75 test/*.xml
74 76 test/reports/*.xml
75 77 test/*.trs
76 78 test/region.reg
  79 +
77 80 examples/python/*.xml
78 81 examples/python/*.html
79 82 examples/cpp/*/*.fits
... ... @@ -85,6 +88,7 @@ examples/cpp/readmodel/readmodel
85 88 examples/cpp/numerics/numerics
86 89 examples/cpp/optimize/optimize
87 90 examples/cpp/interpolate/interpolate
  91 +examples/cpp/readmodel/readmodel
88 92  
89 93 # Binaries
90 94 test/test_GApplication
... ... @@ -106,5 +110,4 @@ test/test_LAT
106 110 test/test_MWL
107 111 test/test_CTA
108 112 test/test_COM
109   -examples/cpp/readmodel/readmodel
110 113  
... ...
src/template/GClass.cpp
... ... @@ -158,14 +158,14 @@ GClass* GClass::clone(void) const
158 158 /***********************************************************************//**
159 159 * @brief Print class information
160 160 ***************************************************************************/
161   -std::string GClass::print(void) const
  161 +std::string GClass::print(const GChatter& chatter) const
162 162 {
163 163 // Initialise result string
164 164 std::string result;
165 165  
166 166 // Append header
167 167 result.append("=== GClass ===");
168   - result.append("\n"+parformat("Name")+m_name);
  168 + result.append("\n"+gammalib::parformat("Name")+m_name);
169 169  
170 170 // Return result
171 171 return result;
... ... @@ -220,41 +220,3 @@ void GClass::free_members(void)
220 220 // Return
221 221 return;
222 222 }
223   -
224   -
225   -/*==========================================================================
226   - = =
227   - = Friends =
228   - = =
229   - ==========================================================================*/
230   -
231   -/***********************************************************************//**
232   - * @brief Output operator
233   - *
234   - * @param[in] os Output stream.
235   - * @param[in] c Class.
236   - ***************************************************************************/
237   -std::ostream& operator<< (std::ostream& os, const GClass& c)
238   -{
239   - // Write class in output stream
240   - os << c.print();
241   -
242   - // Return output stream
243   - return os;
244   -}
245   -
246   -
247   -/***********************************************************************//**
248   - * @brief Log operator
249   - *
250   - * @param[in] log Logger.
251   - * @param[in] c Class.
252   - ***************************************************************************/
253   -GLog& operator<< (GLog& log, const GClass& c)
254   -{
255   - // Write class into logger
256   - log << c.print();
257   -
258   - // Return logger
259   - return log;
260   -}
... ...
src/template/GClass.hpp
... ... @@ -51,7 +51,7 @@ public:
51 51 // Methods
52 52 void clear(void);
53 53 GClass* clone(void) const;
54   - std::string print(void) const;
  54 + std::string print(const GChatter& chatter = NORMAL) const;
55 55  
56 56 protected:
57 57 // Protected methods
... ...
src/template/Makefile 0 → 100644
  1 +CXX=g++
  2 +CFLAGS=-I${GAMMALIB}/include/gammalib
  3 +LDFLAGS=-L${GAMMALIB}/lib -lgamma
  4 +DEPS=
  5 +OBJ=test_GClass.cpp GClass.cpp
  6 +
  7 +test_GClass: $(OBJ)
  8 + $(CXX) -o $@ $^ $(CFLAGS) $(LDFLAGS)
... ...
src/template/test_GClass.cpp 0 → 100644
  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 +}
... ...