From fb55fd6737902ed6270c2518bdc81a6971f9b3a1 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Wed, 10 Apr 2013 00:21:31 -0700 Subject: gras: formalize the weak container api w/ docs address issue #69, we now have a set_container call, which is now formally part of the api. Anyone can call set_container for custom container types. GRAS supports shared ptr and pyobject out of the box. --- lib/element.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/element.cpp') diff --git a/lib/element.cpp b/lib/element.cpp index 989c184..dfc3f57 100644 --- a/lib/element.cpp +++ b/lib/element.cpp @@ -48,6 +48,11 @@ ElementImpl::~ElementImpl(void) if (this->block) this->block_cleanup(); } +void Element::set_container(WeakContainer *container) +{ + (*this)->weak_self.reset(container); +} + bool Element::equals(const Element &rhs) { return this->get() == rhs.get(); -- cgit