Commit e10f23a416ae7688c2fa281a6574138b7e442fb7
1 parent
4b3da407
add app directory
Showing
4 changed files
with
253 additions
and
0 deletions
configure.ac
src/Makefile.am
| ... | ... | @@ -16,6 +16,7 @@ SUBDIRS = support \ |
| 16 | 16 | opt \ |
| 17 | 17 | obs \ |
| 18 | 18 | model \ |
| 19 | + app \ | |
| 19 | 20 | lat |
| 20 | 21 | |
| 21 | 22 | # Define sources for this directory |
| ... | ... | @@ -31,5 +32,6 @@ libgamma_la_LIBADD = support/libsupport.la \ |
| 31 | 32 | opt/libopt.la \ |
| 32 | 33 | obs/libobs.la \ |
| 33 | 34 | model/libmodel.la \ |
| 35 | + app/libapp.la \ | |
| 34 | 36 | lat/liblat.la |
| 35 | 37 | libgamma_la_LDFLAGS = -version-info $(GAMMALIB_LT_VERSION) | ... | ... |
src/template/GClass.cpp
0 → 100644
| 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 2 of the License, or * | |
| 10 | + * (at your option) any later version. * | |
| 11 | + * * | |
| 12 | + ***************************************************************************/ | |
| 13 | +/** | |
| 14 | + * @file GClass.cpp | |
| 15 | + * @brief <brief descriptor> | |
| 16 | + * @author <author> | |
| 17 | + */ | |
| 18 | + | |
| 19 | +/* __ Includes ___________________________________________________________ */ | |
| 20 | +#include "GClass.hpp" | |
| 21 | + | |
| 22 | +/* __ Method name definitions ____________________________________________ */ | |
| 23 | + | |
| 24 | +/* __ Macros _____________________________________________________________ */ | |
| 25 | + | |
| 26 | +/* __ Coding definitions _________________________________________________ */ | |
| 27 | + | |
| 28 | +/* __ Debug definitions __________________________________________________ */ | |
| 29 | + | |
| 30 | + | |
| 31 | +/*========================================================================== | |
| 32 | + = = | |
| 33 | + = Constructors/destructors = | |
| 34 | + = = | |
| 35 | + ==========================================================================*/ | |
| 36 | + | |
| 37 | +/***********************************************************************//** | |
| 38 | + * @brief Void constructor | |
| 39 | + ***************************************************************************/ | |
| 40 | +GClass::GClass(void) | |
| 41 | +{ | |
| 42 | + // Initialise private members for clean destruction | |
| 43 | + init_members(); | |
| 44 | + | |
| 45 | + // Return | |
| 46 | + return; | |
| 47 | +} | |
| 48 | + | |
| 49 | + | |
| 50 | +/***********************************************************************//** | |
| 51 | + * @brief Copy constructor | |
| 52 | + * | |
| 53 | + * @param[in] c Object from which the instance should be built. | |
| 54 | + ***************************************************************************/ | |
| 55 | +GClass::GClass(const GClass& c) | |
| 56 | +{ | |
| 57 | + // Initialise private members for clean destruction | |
| 58 | + init_members(); | |
| 59 | + | |
| 60 | + // Copy members | |
| 61 | + copy_members(c); | |
| 62 | + | |
| 63 | + // Return | |
| 64 | + return; | |
| 65 | +} | |
| 66 | + | |
| 67 | + | |
| 68 | +/***********************************************************************//** | |
| 69 | + * @brief Destructor | |
| 70 | + ***************************************************************************/ | |
| 71 | +GClass::~GClass(void) | |
| 72 | +{ | |
| 73 | + // Free members | |
| 74 | + free_members(); | |
| 75 | + | |
| 76 | + // Return | |
| 77 | + return; | |
| 78 | +} | |
| 79 | + | |
| 80 | + | |
| 81 | +/*========================================================================== | |
| 82 | + = = | |
| 83 | + = Operators = | |
| 84 | + = = | |
| 85 | + ==========================================================================*/ | |
| 86 | + | |
| 87 | +/***********************************************************************//** | |
| 88 | + * @brief Assignment operator | |
| 89 | + * | |
| 90 | + * @param[in] c Object which should be assigned. | |
| 91 | + ***************************************************************************/ | |
| 92 | +GClass& GClass::operator= (const GClass& c) | |
| 93 | +{ | |
| 94 | + // Execute only if object is not identical | |
| 95 | + if (this != &c) { | |
| 96 | + | |
| 97 | + // Free members | |
| 98 | + free_members(); | |
| 99 | + | |
| 100 | + // Initialise private members for clean destruction | |
| 101 | + init_members(); | |
| 102 | + | |
| 103 | + // Copy members | |
| 104 | + copy_members(c); | |
| 105 | + | |
| 106 | + } // endif: object was not identical | |
| 107 | + | |
| 108 | + // Return | |
| 109 | + return *this; | |
| 110 | +} | |
| 111 | + | |
| 112 | + | |
| 113 | +/*========================================================================== | |
| 114 | + = = | |
| 115 | + = Public methods = | |
| 116 | + = = | |
| 117 | + ==========================================================================*/ | |
| 118 | + | |
| 119 | +/*========================================================================== | |
| 120 | + = = | |
| 121 | + = Private methods = | |
| 122 | + = = | |
| 123 | + ==========================================================================*/ | |
| 124 | + | |
| 125 | +/***********************************************************************//** | |
| 126 | + * @brief Initialise class members | |
| 127 | + ***************************************************************************/ | |
| 128 | +void GClass::init_members(void) | |
| 129 | +{ | |
| 130 | + // Initialise members | |
| 131 | + m_name.clear(); | |
| 132 | + | |
| 133 | + // Return | |
| 134 | + return; | |
| 135 | +} | |
| 136 | + | |
| 137 | + | |
| 138 | +/***********************************************************************//** | |
| 139 | + * @brief Copy class members | |
| 140 | + * | |
| 141 | + * @param[in] c Object from which members which should be copied. | |
| 142 | + ***************************************************************************/ | |
| 143 | +void GClass::copy_members(const GClass& c) | |
| 144 | +{ | |
| 145 | + // Copy attributes | |
| 146 | + m_name = c.m_name; | |
| 147 | + | |
| 148 | + // Return | |
| 149 | + return; | |
| 150 | +} | |
| 151 | + | |
| 152 | + | |
| 153 | +/***********************************************************************//** | |
| 154 | + * @brief Delete class members | |
| 155 | + ***************************************************************************/ | |
| 156 | +void GClass::free_members(void) | |
| 157 | +{ | |
| 158 | + // Free memory | |
| 159 | + //if (m_par != NULL) delete [] m_par; | |
| 160 | + | |
| 161 | + // Signal free pointers | |
| 162 | + //m_par = NULL; | |
| 163 | + | |
| 164 | + // Return | |
| 165 | + return; | |
| 166 | +} | |
| 167 | + | |
| 168 | + | |
| 169 | +/*========================================================================== | |
| 170 | + = = | |
| 171 | + = Friends = | |
| 172 | + = = | |
| 173 | + ==========================================================================*/ | |
| 174 | + | |
| 175 | +/***********************************************************************//** | |
| 176 | + * @brief Put object in output stream | |
| 177 | + * | |
| 178 | + * @param[in] os Output stream into which the model will be dumped | |
| 179 | + * @param[in] c Object to be dumped | |
| 180 | + ***************************************************************************/ | |
| 181 | +std::ostream& operator<< (std::ostream& os, const GClass& c) | |
| 182 | +{ | |
| 183 | + // Put object in stream | |
| 184 | + os << "=== GClass ===" << std::endl; | |
| 185 | + | |
| 186 | + // Return output stream | |
| 187 | + return os; | |
| 188 | +} | |
| 189 | + | |
| 190 | + | ... | ... |
src/template/GClass.hpp
0 → 100644
| 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 2 of the License, or * | |
| 10 | + * (at your option) any later version. * | |
| 11 | + * * | |
| 12 | + ***************************************************************************/ | |
| 13 | +/** | |
| 14 | + * @file GClass.hpp | |
| 15 | + * @brief <brief descriptor> | |
| 16 | + * @author <author> | |
| 17 | + */ | |
| 18 | + | |
| 19 | +#ifndef GCLASS_HPP | |
| 20 | +#define GCLASS_HPP | |
| 21 | + | |
| 22 | +/* __ Includes ___________________________________________________________ */ | |
| 23 | +#include <iostream> | |
| 24 | + | |
| 25 | + | |
| 26 | +/***********************************************************************//** | |
| 27 | + * @class GClass | |
| 28 | + * | |
| 29 | + * @brief <brief descriptor> interface defintion. | |
| 30 | + ***************************************************************************/ | |
| 31 | +class GClass { | |
| 32 | + | |
| 33 | + // Friend classes | |
| 34 | + friend class GModels; | |
| 35 | + | |
| 36 | + // I/O friends | |
| 37 | + friend std::ostream& operator<< (std::ostream& os, const GClass& c); | |
| 38 | + | |
| 39 | +public: | |
| 40 | + // Constructors and destructors | |
| 41 | + GClass(void); | |
| 42 | + GClass(const GClass& c); | |
| 43 | + ~GClass(void); | |
| 44 | + | |
| 45 | + // Operators | |
| 46 | + GClass& operator= (const GClass& c); | |
| 47 | + | |
| 48 | + // Methods | |
| 49 | + | |
| 50 | +protected: | |
| 51 | + // Protected methods | |
| 52 | + void init_members(void); | |
| 53 | + void copy_members(const GClass& c); | |
| 54 | + void free_members(void); | |
| 55 | + | |
| 56 | + // Protected data members | |
| 57 | + std::string m_name; //!< Name | |
| 58 | +}; | |
| 59 | + | |
| 60 | +#endif /* GCLASS_HPP */ | ... | ... |