Commit 0b624dc3d6f331b3f6dfba1372d4ac0f5a6c122c
1 parent
c2675d4f
Expose protected ctool baseclass methods in Python.
Showing
2 changed files
with
28 additions
and
1 deletions
pyext/ctool.i
| 1 | /*************************************************************************** | 1 | /*************************************************************************** |
| 2 | * ctool - ctool base class * | 2 | * ctool - ctool base class * |
| 3 | * ----------------------------------------------------------------------- * | 3 | * ----------------------------------------------------------------------- * |
| 4 | - * copyright (C) 2014 by Juergen Knoedlseder * | 4 | + * copyright (C) 2014-2015 by Juergen Knoedlseder * |
| 5 | * ----------------------------------------------------------------------- * | 5 | * ----------------------------------------------------------------------- * |
| 6 | * * | 6 | * * |
| 7 | * This program is free software: you can redistribute it and/or modify * | 7 | * This program is free software: you can redistribute it and/or modify * |
| @@ -25,6 +25,7 @@ | @@ -25,6 +25,7 @@ | ||
| 25 | */ | 25 | */ |
| 26 | %{ | 26 | %{ |
| 27 | /* Put headers and other declarations here that are needed for compilation */ | 27 | /* Put headers and other declarations here that are needed for compilation */ |
| 28 | +#define SWIG | ||
| 28 | #include "ctool.hpp" | 29 | #include "ctool.hpp" |
| 29 | %} | 30 | %} |
| 30 | 31 | ||
| @@ -51,4 +52,26 @@ public: | @@ -51,4 +52,26 @@ public: | ||
| 51 | 52 | ||
| 52 | // Public methods | 53 | // Public methods |
| 53 | virtual void execute(void); | 54 | virtual void execute(void); |
| 55 | + | ||
| 56 | + // Protected methods | ||
| 57 | + void init_members(void); | ||
| 58 | + void copy_members(const ctool& app); | ||
| 59 | + void free_members(void); | ||
| 60 | + const bool& read_ahead(void) const; | ||
| 61 | + GObservations get_observations(const bool& get_response = true); | ||
| 62 | + | ||
| 63 | + // Protected methods that create objects from user parameters | ||
| 64 | + GEbounds create_ebounds(void); | ||
| 65 | + GSkymap create_map(const GObservations& obs); | ||
| 66 | + GCTAEventCube create_cube(const GObservations& obs); | ||
| 67 | + GCTAObservation create_cta_obs(void); | ||
| 68 | + | ||
| 69 | + // Protected methods that check user parameters | ||
| 70 | + void require_inobs(const std::string& method); | ||
| 71 | + | ||
| 72 | + // Protected support methods | ||
| 73 | + void set_response(GObservations& obs); | ||
| 74 | + void set_obs_response(GCTAObservation* obs); | ||
| 75 | + GSkyDir get_mean_pointing(const GObservations& obs); | ||
| 76 | + size_t get_current_rss(void); | ||
| 54 | }; | 77 | }; |
src/support/ctool.hpp
| @@ -60,7 +60,11 @@ public: | @@ -60,7 +60,11 @@ public: | ||
| 60 | // Public methods | 60 | // Public methods |
| 61 | virtual void execute(void); | 61 | virtual void execute(void); |
| 62 | 62 | ||
| 63 | +#ifdef SWIG | ||
| 64 | +public: | ||
| 65 | +#else | ||
| 63 | protected: | 66 | protected: |
| 67 | +#endif | ||
| 64 | // Protected methods | 68 | // Protected methods |
| 65 | void init_members(void); | 69 | void init_members(void); |
| 66 | void copy_members(const ctool& app); | 70 | void copy_members(const ctool& app); |