diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/gras/element.hpp | 6 | ||||
-rw-r--r-- | include/gras/element.i | 11 |
2 files changed, 7 insertions, 10 deletions
diff --git a/include/gras/element.hpp b/include/gras/element.hpp index 0bebc14..40a24cf 100644 --- a/include/gras/element.hpp +++ b/include/gras/element.hpp @@ -31,6 +31,12 @@ struct GRAS_API Element : ElementBase, boost::enable_shared_from_this<Element> /*virtual*/ ~Element(void); + /*! + * Check if another element is the same as this one. + * \return true if the rhs is the same as *this. + */ + bool equals(const Element &rhs); + /******************************************************************* * identification interface ******************************************************************/ diff --git a/include/gras/element.i b/include/gras/element.i index be3814e..8f04a3d 100644 --- a/include/gras/element.i +++ b/include/gras/element.i @@ -34,22 +34,13 @@ //////////////////////////////////////////////////////////////////////// // Operator overloads for Element //////////////////////////////////////////////////////////////////////// -%{ - -inline bool gras_element_equal(const gras::Element &lhs, const gras::Element &rhs) -{ - return lhs.get() == rhs.get(); -} - -%} - %extend gras::Element { %insert("python") %{ def __eq__(self, rhs): if not isinstance(rhs, Element): return False - return gras_element_equal(self, rhs) + return self.equals(rhs) def __str__(self): return self.to_string() |