summaryrefslogtreecommitdiff
path: root/lib/element.cpp
diff options
context:
space:
mode:
authorJosh Blum2012-09-03 05:44:53 -0700
committerJosh Blum2012-09-03 05:44:53 -0700
commitd3c303b2f78e3657dc89e23478316502cedc6e7b (patch)
tree08d1e2f9262a59349f5042cbe5c3eab2638cfa6d /lib/element.cpp
parentb9d92f31d7eee9bf1707fa622b6bea531e41c693 (diff)
downloadsandhi-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.cpp3
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;
}