From 211c2251c3ed3cd6bd57b673e4bfa89e92af86e1 Mon Sep 17 00:00:00 2001 From: Jürgen Knödlseder Date: Fri, 12 Apr 2013 22:16:01 +0200 Subject: [PATCH] Remove const at() method and __str()__() extension. --- pyext/GModels.i | 46 +++++++++++++++++++++------------------------- 1 file changed, 21 insertions(+), 25 deletions(-) diff --git a/pyext/GModels.i b/pyext/GModels.i index 0154fd4..ae488a1 100644 --- a/pyext/GModels.i +++ b/pyext/GModels.i @@ -59,28 +59,27 @@ public: virtual ~GModels(void); // Methods - void clear(void); - GModels* clone(void) const; - GModel* at(const int& index); - const GModel* at(const int& index) const; - int size(void) const; - bool isempty(void) const; - GModel* set(const int& index, const GModel& model); - GModel* set(const std::string& name, const GModel& model); - GModel* append(const GModel& model); - GModel* insert(const int& index, const GModel& model); - GModel* insert(const std::string& name, const GModel& model); - void remove(const int& index); - void remove(const std::string& name); - void reserve(const int& num); - void extend(const GModels& models); - bool contains(const std::string& name) const; - void load(const std::string& filename); - void save(const std::string& filename) const; - void read(const GXml& xml); - void write(GXml& xml) const; - double eval(const GEvent& event, const GObservation& obs) const; - double eval_gradients(const GEvent& event, const GObservation& obs) const; + void clear(void); + GModels* clone(void) const; + GModel* at(const int& index); + int size(void) const; + bool isempty(void) const; + GModel* set(const int& index, const GModel& model); + GModel* set(const std::string& name, const GModel& model); + GModel* append(const GModel& model); + GModel* insert(const int& index, const GModel& model); + GModel* insert(const std::string& name, const GModel& model); + void remove(const int& index); + void remove(const std::string& name); + void reserve(const int& num); + void extend(const GModels& models); + bool contains(const std::string& name) const; + void load(const std::string& filename); + void save(const std::string& filename) const; + void read(const GXml& xml); + void write(GXml& xml) const; + double eval(const GEvent& event, const GObservation& obs) const; + double eval_gradients(const GEvent& event, const GObservation& obs) const; }; @@ -88,9 +87,6 @@ public: * @brief GModels class extension ***************************************************************************/ %extend GModels { - char *__str__() { - return tochar(self->print()); - } GModel* __getitem__(const int& index) { if (index >= 0 && index < self->size()) { return (*self)[index]; -- libgit2 0.21.4