From 0b624dc3d6f331b3f6dfba1372d4ac0f5a6c122c Mon Sep 17 00:00:00 2001 From: Jürgen Knödlseder Date: Fri, 16 Jan 2015 09:55:36 +0100 Subject: [PATCH] Expose protected ctool baseclass methods in Python. --- pyext/ctool.i | 25 ++++++++++++++++++++++++- src/support/ctool.hpp | 4 ++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/pyext/ctool.i b/pyext/ctool.i index 9923689..c98f8d8 100644 --- a/pyext/ctool.i +++ b/pyext/ctool.i @@ -1,7 +1,7 @@ /*************************************************************************** * ctool - ctool base class * * ----------------------------------------------------------------------- * - * copyright (C) 2014 by Juergen Knoedlseder * + * copyright (C) 2014-2015 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -25,6 +25,7 @@ */ %{ /* Put headers and other declarations here that are needed for compilation */ +#define SWIG #include "ctool.hpp" %} @@ -51,4 +52,26 @@ public: // Public methods virtual void execute(void); + + // Protected methods + void init_members(void); + void copy_members(const ctool& app); + void free_members(void); + const bool& read_ahead(void) const; + GObservations get_observations(const bool& get_response = true); + + // Protected methods that create objects from user parameters + GEbounds create_ebounds(void); + GSkymap create_map(const GObservations& obs); + GCTAEventCube create_cube(const GObservations& obs); + GCTAObservation create_cta_obs(void); + + // Protected methods that check user parameters + void require_inobs(const std::string& method); + + // Protected support methods + void set_response(GObservations& obs); + void set_obs_response(GCTAObservation* obs); + GSkyDir get_mean_pointing(const GObservations& obs); + size_t get_current_rss(void); }; diff --git a/src/support/ctool.hpp b/src/support/ctool.hpp index 0f9a46c..ad20618 100644 --- a/src/support/ctool.hpp +++ b/src/support/ctool.hpp @@ -60,7 +60,11 @@ public: // Public methods virtual void execute(void); +#ifdef SWIG +public: +#else protected: +#endif // Protected methods void init_members(void); void copy_members(const ctool& app); -- libgit2 0.21.4