Commit 5a6fea13ba492d3f855d832af7969d9cc6f2ea21
1 parent
3b9e0e5f
ctselect now derives from ctool base class.
Showing
4 changed files
with
25 additions
and
28 deletions
pyext/ctselect.i
| 1 | 1 | /*************************************************************************** |
| 2 | - * ctselect - CTA data selection tool * | |
| 2 | + * ctselect - Data selection tool * | |
| 3 | 3 | * ----------------------------------------------------------------------- * |
| 4 | 4 | * copyright (C) 2010-2014 by Jurgen Knodlseder * |
| 5 | 5 | * ----------------------------------------------------------------------- * |
| ... | ... | @@ -20,22 +20,21 @@ |
| 20 | 20 | ***************************************************************************/ |
| 21 | 21 | /** |
| 22 | 22 | * @file ctselect.i |
| 23 | - * @brief CTA data selection tool Python interface definition | |
| 23 | + * @brief Data selection tool definition | |
| 24 | 24 | * @author Juergen Knoedlseder |
| 25 | 25 | */ |
| 26 | 26 | %{ |
| 27 | 27 | /* Put headers and other declarations here that are needed for compilation */ |
| 28 | 28 | #include "ctselect.hpp" |
| 29 | -#include "GTools.hpp" | |
| 30 | 29 | %} |
| 31 | 30 | |
| 32 | 31 | |
| 33 | 32 | /***********************************************************************//** |
| 34 | 33 | * @class ctselect |
| 35 | 34 | * |
| 36 | - * @brief CTA data selection tool Python interface | |
| 35 | + * @brief Data selection tool | |
| 37 | 36 | ***************************************************************************/ |
| 38 | -class ctselect : public GApplication { | |
| 37 | +class ctselect : public ctool { | |
| 39 | 38 | public: |
| 40 | 39 | // Constructors and destructors |
| 41 | 40 | ctselect(void); |
| ... | ... | @@ -55,7 +54,7 @@ public: |
| 55 | 54 | |
| 56 | 55 | |
| 57 | 56 | /***********************************************************************//** |
| 58 | - * @brief CTA data selection tool Python extension | |
| 57 | + * @brief Data selection tool Python extension | |
| 59 | 58 | ***************************************************************************/ |
| 60 | 59 | %extend ctselect { |
| 61 | 60 | ctselect copy() { | ... | ... |
src/ctselect/Makefile.am
| 1 | 1 | ## Process this file with automake to produce Makefile.in |
| 2 | 2 | |
| 3 | +# Set include directories | |
| 4 | +INCLUDES = -I$(top_srcdir)/src/support | |
| 5 | + | |
| 3 | 6 | # Program name |
| 4 | 7 | bin_PROGRAMS = ctselect |
| 5 | 8 | |
| ... | ... | @@ -14,7 +17,7 @@ libctselect_la_SOURCES = $(sources) |
| 14 | 17 | ctselect_SOURCES = main.cpp |
| 15 | 18 | ctselect_LDFLAGS = $(LIB_LINK_OPTION) @LDFLAGS@ |
| 16 | 19 | ctselect_CPPFLAGS = @CPPFLAGS@ |
| 17 | -ctselect_LDADD = libctselect.la | |
| 20 | +ctselect_LDADD = libctselect.la $(top_srcdir)/src/support/libsupport.la | |
| 18 | 21 | |
| 19 | 22 | # Parameter files |
| 20 | 23 | pfilesdir = $(prefix)/syspfiles | ... | ... |
src/ctselect/ctselect.cpp
| 1 | 1 | /*************************************************************************** |
| 2 | - * ctselect - CTA data selection tool * | |
| 2 | + * ctselect - Data selection tool * | |
| 3 | 3 | * ----------------------------------------------------------------------- * |
| 4 | 4 | * copyright (C) 2010-2014 by Juergen Knoedlseder * |
| 5 | 5 | * ----------------------------------------------------------------------- * |
| ... | ... | @@ -20,7 +20,7 @@ |
| 20 | 20 | ***************************************************************************/ |
| 21 | 21 | /** |
| 22 | 22 | * @file ctselect.cpp |
| 23 | - * @brief CTA data selection tool implementation | |
| 23 | + * @brief Data selection tool definition | |
| 24 | 24 | * @author Juergen Knoedlseder |
| 25 | 25 | */ |
| 26 | 26 | |
| ... | ... | @@ -52,14 +52,11 @@ |
| 52 | 52 | /***********************************************************************//** |
| 53 | 53 | * @brief Void constructor |
| 54 | 54 | ***************************************************************************/ |
| 55 | -ctselect::ctselect(void) : GApplication(CTSELECT_NAME, CTSELECT_VERSION) | |
| 55 | +ctselect::ctselect(void) : ctool(CTSELECT_NAME, CTSELECT_VERSION) | |
| 56 | 56 | { |
| 57 | 57 | // Initialise members |
| 58 | 58 | init_members(); |
| 59 | 59 | |
| 60 | - // Write header into logger | |
| 61 | - log_header(); | |
| 62 | - | |
| 63 | 60 | // Return |
| 64 | 61 | return; |
| 65 | 62 | } |
| ... | ... | @@ -74,7 +71,7 @@ ctselect::ctselect(void) : GApplication(CTSELECT_NAME, CTSELECT_VERSION) |
| 74 | 71 | * an observation container. |
| 75 | 72 | ***************************************************************************/ |
| 76 | 73 | ctselect::ctselect(const GObservations& obs) : |
| 77 | - GApplication(CTSELECT_NAME, CTSELECT_VERSION) | |
| 74 | + ctool(CTSELECT_NAME, CTSELECT_VERSION) | |
| 78 | 75 | { |
| 79 | 76 | // Initialise members |
| 80 | 77 | init_members(); |
| ... | ... | @@ -82,9 +79,6 @@ ctselect::ctselect(const GObservations& obs) : |
| 82 | 79 | // Set observations |
| 83 | 80 | m_obs = obs; |
| 84 | 81 | |
| 85 | - // Write header into logger | |
| 86 | - log_header(); | |
| 87 | - | |
| 88 | 82 | // Return |
| 89 | 83 | return; |
| 90 | 84 | } |
| ... | ... | @@ -99,14 +93,11 @@ ctselect::ctselect(const GObservations& obs) : |
| 99 | 93 | * @param[in] argv Array of command line arguments. |
| 100 | 94 | ***************************************************************************/ |
| 101 | 95 | ctselect::ctselect(int argc, char *argv[]) : |
| 102 | - GApplication(CTSELECT_NAME, CTSELECT_VERSION, argc, argv) | |
| 96 | + ctool(CTSELECT_NAME, CTSELECT_VERSION, argc, argv) | |
| 103 | 97 | { |
| 104 | 98 | // Initialise members |
| 105 | 99 | init_members(); |
| 106 | 100 | |
| 107 | - // Write header into logger | |
| 108 | - log_header(); | |
| 109 | - | |
| 110 | 101 | // Return |
| 111 | 102 | return; |
| 112 | 103 | } |
| ... | ... | @@ -117,7 +108,7 @@ ctselect::ctselect(int argc, char *argv[]) : |
| 117 | 108 | * |
| 118 | 109 | * @param[in] app Application. |
| 119 | 110 | ***************************************************************************/ |
| 120 | -ctselect::ctselect(const ctselect& app) : GApplication(app) | |
| 111 | +ctselect::ctselect(const ctselect& app) : ctool(app) | |
| 121 | 112 | { |
| 122 | 113 | // Initialise members |
| 123 | 114 | init_members(); |
| ... | ... | @@ -154,13 +145,13 @@ ctselect::~ctselect(void) |
| 154 | 145 | * |
| 155 | 146 | * @param[in] app Application. |
| 156 | 147 | ***************************************************************************/ |
| 157 | -ctselect& ctselect::operator= (const ctselect& app) | |
| 148 | +ctselect& ctselect::operator=(const ctselect& app) | |
| 158 | 149 | { |
| 159 | 150 | // Execute only if object is not identical |
| 160 | 151 | if (this != &app) { |
| 161 | 152 | |
| 162 | 153 | // Copy base class members |
| 163 | - this->GApplication::operator=(app); | |
| 154 | + this->ctool::operator=(app); | |
| 164 | 155 | |
| 165 | 156 | // Free members |
| 166 | 157 | free_members(); |
| ... | ... | @@ -191,10 +182,12 @@ void ctselect::clear(void) |
| 191 | 182 | { |
| 192 | 183 | // Free members |
| 193 | 184 | free_members(); |
| 185 | + this->ctool::free_members(); | |
| 194 | 186 | this->GApplication::free_members(); |
| 195 | 187 | |
| 196 | 188 | // Initialise members |
| 197 | 189 | this->GApplication::init_members(); |
| 190 | + this->ctool::init_members(); | |
| 198 | 191 | init_members(); |
| 199 | 192 | |
| 200 | 193 | // Return | ... | ... |
src/ctselect/ctselect.hpp
| 1 | 1 | /*************************************************************************** |
| 2 | - * ctselect - CTA data selection tool * | |
| 2 | + * ctselect - Data selection tool * | |
| 3 | 3 | * ----------------------------------------------------------------------- * |
| 4 | 4 | * copyright (C) 2010-2014 by Juergen Knoedlseder * |
| 5 | 5 | * ----------------------------------------------------------------------- * |
| ... | ... | @@ -20,7 +20,7 @@ |
| 20 | 20 | ***************************************************************************/ |
| 21 | 21 | /** |
| 22 | 22 | * @file ctselect.hpp |
| 23 | - * @brief CTA data selection tool definition | |
| 23 | + * @brief Data selection tool definition | |
| 24 | 24 | * @author Juergen Knoedlseder |
| 25 | 25 | */ |
| 26 | 26 | |
| ... | ... | @@ -32,6 +32,7 @@ |
| 32 | 32 | #include <string> |
| 33 | 33 | #include "GammaLib.hpp" |
| 34 | 34 | #include "GCTALib.hpp" |
| 35 | +#include "ctool.hpp" | |
| 35 | 36 | |
| 36 | 37 | /* __Definitions _________________________________________________________ */ |
| 37 | 38 | #define CTSELECT_NAME "ctselect" |
| ... | ... | @@ -41,9 +42,10 @@ |
| 41 | 42 | /***********************************************************************//** |
| 42 | 43 | * @class ctselect |
| 43 | 44 | * |
| 44 | - * @brief CTA data selection tool interface defintion. | |
| 45 | + * @brief Data selection tool | |
| 45 | 46 | ***************************************************************************/ |
| 46 | -class ctselect : public GApplication { | |
| 47 | +class ctselect : public ctool { | |
| 48 | + | |
| 47 | 49 | public: |
| 48 | 50 | // Constructors and destructors |
| 49 | 51 | ctselect(void); | ... | ... |