diff options
author | Josh Blum | 2013-04-10 00:21:31 -0700 |
---|---|---|
committer | Josh Blum | 2013-04-10 00:21:31 -0700 |
commit | fb55fd6737902ed6270c2518bdc81a6971f9b3a1 (patch) | |
tree | c31dcb488f97f4c016ad326c726d5f42bcb6bca0 /lib/element.cpp | |
parent | ca4819c56e7f085c1358cd75a9f4635ce3ae2f1f (diff) | |
download | sandhi-fb55fd6737902ed6270c2518bdc81a6971f9b3a1.tar.gz sandhi-fb55fd6737902ed6270c2518bdc81a6971f9b3a1.tar.bz2 sandhi-fb55fd6737902ed6270c2518bdc81a6971f9b3a1.zip |
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.
Diffstat (limited to 'lib/element.cpp')
-rw-r--r-- | lib/element.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
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(); |