From 7612da32a97cd0f7617492b2a3c37edf5abc0f2e Mon Sep 17 00:00:00 2001 From: Jürgen Knödlseder Date: Wed, 10 Apr 2013 21:26:04 +0200 Subject: [PATCH] obs() method returns now a const reference. --- pyext/ctbin.i | 18 +++++++++--------- src/ctbin/ctbin.hpp | 27 +++++++++++++++++++-------- 2 files changed, 28 insertions(+), 17 deletions(-) diff --git a/pyext/ctbin.i b/pyext/ctbin.i index de4ba79..cb2fde8 100644 --- a/pyext/ctbin.i +++ b/pyext/ctbin.i @@ -1,7 +1,7 @@ /*************************************************************************** * ctbin - CTA data binning tool * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2011 by Jurgen Knodlseder * + * copyright (C) 2010-2013 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -21,7 +21,7 @@ /** * @file ctbin.i * @brief CTA data binning tool Python interface definition - * @author J. Knodlseder + * @author Juergen Knoedlseder */ %{ /* Put headers and other declarations here that are needed for compilation */ @@ -45,13 +45,13 @@ public: virtual ~ctbin(void); // Methods - void clear(void); - void execute(void); - void run(void); - void save(void); - GObservations& obs(void) { return m_obs; } - void get_parameters(void); - void bin_events(GCTAObservation* obs); + void clear(void); + void execute(void); + void run(void); + void save(void); + const GObservations& obs(void) const; + void get_parameters(void); + void bin_events(GCTAObservation* obs); }; diff --git a/src/ctbin/ctbin.hpp b/src/ctbin/ctbin.hpp index 0841fe1..0aa70d3 100644 --- a/src/ctbin/ctbin.hpp +++ b/src/ctbin/ctbin.hpp @@ -57,16 +57,16 @@ public: virtual ~ctbin(void); // Operators - ctbin& operator= (const ctbin& app); + ctbin& operator=(const ctbin& app); // Methods - void clear(void); - void execute(void); - void run(void); - void save(void); - GObservations& obs(void) { return m_obs; } - void get_parameters(void); - void bin_events(GCTAObservation* obs); + void clear(void); + void execute(void); + void run(void); + void save(void); + const GObservations& obs(void) const; + void get_parameters(void); + void bin_events(GCTAObservation* obs); protected: // Protected methods @@ -102,4 +102,15 @@ protected: bool m_read_ahead; //!< Read ahead parameters }; +/***********************************************************************//** + * @brief Return observation container + * + * @return Reference to observation container + ***************************************************************************/ +inline +const GObservations& ctbin::obs(void) const +{ + return m_obs; +} + #endif /* CTBIN_HPP */ -- libgit2 0.21.4