diff options
author | Josh Blum | 2012-09-03 05:44:53 -0700 |
---|---|---|
committer | Josh Blum | 2012-09-03 05:44:53 -0700 |
commit | d3c303b2f78e3657dc89e23478316502cedc6e7b (patch) | |
tree | 08d1e2f9262a59349f5042cbe5c3eab2638cfa6d /lib/element.cpp | |
parent | b9d92f31d7eee9bf1707fa622b6bea531e41c693 (diff) | |
download | sandhi-d3c303b2f78e3657dc89e23478316502cedc6e7b.tar.gz sandhi-d3c303b2f78e3657dc89e23478316502cedc6e7b.tar.bz2 sandhi-d3c303b2f78e3657dc89e23478316502cedc6e7b.zip |
created shared_to_element and use shared_from_this
Allows element to be used in a derived class w/
or without a shared pointer. Python/C++
Diffstat (limited to 'lib/element.cpp')
-rw-r--r-- | lib/element.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/element.cpp b/lib/element.cpp index 861a2dc..db0bbac 100644 --- a/lib/element.cpp +++ b/lib/element.cpp @@ -46,8 +46,9 @@ ElementImpl::~ElementImpl(void) if (this->topology) this->hier_block_cleanup(); } -const Element &Element::get_base(void) const +Element &Element::shared_to_element(void) { + this->weak_self = this->shared_from_this(); return *this; } |