Commit 7612da32a97cd0f7617492b2a3c37edf5abc0f2e

Authored by Jürgen Knödlseder
1 parent d9f17cc9

obs() method returns now a const reference.

pyext/ctbin.i
1 /*************************************************************************** 1 /***************************************************************************
2 * ctbin - CTA data binning tool * 2 * ctbin - CTA data binning tool *
3 * ----------------------------------------------------------------------- * 3 * ----------------------------------------------------------------------- *
4 - * copyright (C) 2010-2011 by Jurgen Knodlseder * 4 + * copyright (C) 2010-2013 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 *
@@ -21,7 +21,7 @@ @@ -21,7 +21,7 @@
21 /** 21 /**
22 * @file ctbin.i 22 * @file ctbin.i
23 * @brief CTA data binning tool Python interface definition 23 * @brief CTA data binning tool Python interface definition
24 - * @author J. Knodlseder 24 + * @author Juergen Knoedlseder
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 */
@@ -45,13 +45,13 @@ public: @@ -45,13 +45,13 @@ public:
45 virtual ~ctbin(void); 45 virtual ~ctbin(void);
46 46
47 // Methods 47 // Methods
48 - void clear(void);  
49 - void execute(void);  
50 - void run(void);  
51 - void save(void);  
52 - GObservations& obs(void) { return m_obs; }  
53 - void get_parameters(void);  
54 - void bin_events(GCTAObservation* obs); 48 + void clear(void);
  49 + void execute(void);
  50 + void run(void);
  51 + void save(void);
  52 + const GObservations& obs(void) const;
  53 + void get_parameters(void);
  54 + void bin_events(GCTAObservation* obs);
55 }; 55 };
56 56
57 57
src/ctbin/ctbin.hpp
@@ -57,16 +57,16 @@ public: @@ -57,16 +57,16 @@ public:
57 virtual ~ctbin(void); 57 virtual ~ctbin(void);
58 58
59 // Operators 59 // Operators
60 - ctbin& operator= (const ctbin& app); 60 + ctbin& operator=(const ctbin& app);
61 61
62 // Methods 62 // Methods
63 - void clear(void);  
64 - void execute(void);  
65 - void run(void);  
66 - void save(void);  
67 - GObservations& obs(void) { return m_obs; }  
68 - void get_parameters(void);  
69 - void bin_events(GCTAObservation* obs); 63 + void clear(void);
  64 + void execute(void);
  65 + void run(void);
  66 + void save(void);
  67 + const GObservations& obs(void) const;
  68 + void get_parameters(void);
  69 + void bin_events(GCTAObservation* obs);
70 70
71 protected: 71 protected:
72 // Protected methods 72 // Protected methods
@@ -102,4 +102,15 @@ protected: @@ -102,4 +102,15 @@ protected:
102 bool m_read_ahead; //!< Read ahead parameters 102 bool m_read_ahead; //!< Read ahead parameters
103 }; 103 };
104 104
  105 +/***********************************************************************//**
  106 + * @brief Return observation container
  107 + *
  108 + * @return Reference to observation container
  109 + ***************************************************************************/
  110 +inline
  111 +const GObservations& ctbin::obs(void) const
  112 +{
  113 + return m_obs;
  114 +}
  115 +
105 #endif /* CTBIN_HPP */ 116 #endif /* CTBIN_HPP */