summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Blum2013-02-21 19:48:54 -0800
committerJosh Blum2013-02-21 19:48:54 -0800
commit704e767819c1375012a5f8e1853d1c712750c3e0 (patch)
treecaa79a9e639ddf364a16abff53ac9c29100daba7
parentd9a62c13b76de2c6f1549cec92ee07f2411327a9 (diff)
downloadsandhi-704e767819c1375012a5f8e1853d1c712750c3e0.tar.gz
sandhi-704e767819c1375012a5f8e1853d1c712750c3e0.tar.bz2
sandhi-704e767819c1375012a5f8e1853d1c712750c3e0.zip
gras: inline shared to element so client libs dont need this symbol
-rw-r--r--include/gras/element.hpp10
-rw-r--r--lib/element.cpp10
2 files changed, 9 insertions, 11 deletions
diff --git a/include/gras/element.hpp b/include/gras/element.hpp
index 1ea25c3..423053e 100644
--- a/include/gras/element.hpp
+++ b/include/gras/element.hpp
@@ -55,7 +55,15 @@ struct GRAS_API Element : ElementBase, boost::enable_shared_from_this<Element>
}
//! Convert a shared ptr of a derived class to an Element
- Element &shared_to_element(void);
+ inline Element &shared_to_element(void)
+ {
+ try
+ {
+ this->weak_self = this->shared_from_this();
+ }
+ catch(...){}
+ return *this;
+ }
//! for internal use only
boost::weak_ptr<Element> weak_self;
diff --git a/lib/element.cpp b/lib/element.cpp
index 27a5db0..a10e298 100644
--- a/lib/element.cpp
+++ b/lib/element.cpp
@@ -35,16 +35,6 @@ ElementImpl::~ElementImpl(void)
if (this->block) this->block_cleanup();
}
-Element &Element::shared_to_element(void)
-{
- try
- {
- this->weak_self = this->shared_from_this();
- }
- catch(...){}
- return *this;
-}
-
long Element::unique_id(void) const
{
return (*this)->unique_id;