summaryrefslogtreecommitdiff
path: root/include/gras/detail/element.hpp
diff options
context:
space:
mode:
authorJosh Blum2013-04-03 23:31:34 -0700
committerJosh Blum2013-04-03 23:31:34 -0700
commitc85fe5cb75d32544eb89a573e8df61757a940766 (patch)
treea1e0fb013bb2d31823738f5ab7de7b69316193ed /include/gras/detail/element.hpp
parent0651aff49ae7e066bc301faeecfbd519c4743849 (diff)
downloadsandhi-c85fe5cb75d32544eb89a573e8df61757a940766.tar.gz
sandhi-c85fe5cb75d32544eb89a573e8df61757a940766.tar.bz2
sandhi-c85fe5cb75d32544eb89a573e8df61757a940766.zip
gras: code cleanup and comments from last commit
Diffstat (limited to 'include/gras/detail/element.hpp')
-rw-r--r--include/gras/detail/element.hpp25
1 files changed, 0 insertions, 25 deletions
diff --git a/include/gras/detail/element.hpp b/include/gras/detail/element.hpp
index 22a63a0..2b97c8f 100644
--- a/include/gras/detail/element.hpp
+++ b/include/gras/detail/element.hpp
@@ -5,37 +5,12 @@
namespace gras
{
- struct WeakElementSharedPtr : WeakElement
- {
- WeakElementSharedPtr(boost::weak_ptr<Element> weak_self)
- {
- _weak_self = weak_self;
- }
- boost::shared_ptr<void> lock(void)
- {
- return _weak_self.lock();
- }
- boost::weak_ptr<Element> _weak_self;
- };
-
template <typename T>
inline Element::Element(const boost::shared_ptr<T> &elem)
{
*this = elem->shared_to_element();
}
- //! Convert a shared ptr of a derived class to an Element
- inline Element &Element::shared_to_element(void)
- {
- try
- {
- if (not this->weak_self)
- this->weak_self.reset(new WeakElementSharedPtr(this->shared_from_this()));
- }
- catch(...){}
- return *this;
- }
-
} //namespace gras
#endif /*INCLUDED_GRAS_DETAIL_ELEMENT_HPP*/