diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/element.cpp | 5 | ||||
-rw-r--r-- | lib/element_impl.hpp | 1 |
2 files changed, 4 insertions, 2 deletions
diff --git a/lib/element.cpp b/lib/element.cpp index 1781fc7..43a6d06 100644 --- a/lib/element.cpp +++ b/lib/element.cpp @@ -18,6 +18,7 @@ Element::Element(const std::string &name) { this->reset(new ElementImpl()); (*this)->name = name; + (*this)->self = this; size_t which = 0; while (true) { @@ -106,7 +107,7 @@ void Element::adopt_element(const std::string &name, const Element &child) (*this)->children[name] = child; } -Block *Element::locate_block(const std::string &path) +Element *Element::locate_element(const std::string &path) { //split the paths into nodes std::vector<std::string> nodes; @@ -142,5 +143,5 @@ Block *Element::locate_block(const std::string &path) } //return block ptr as result - return elem->block_data->block; + return elem->self; } diff --git a/lib/element_impl.hpp b/lib/element_impl.hpp index 23f7127..91497ed 100644 --- a/lib/element_impl.hpp +++ b/lib/element_impl.hpp @@ -43,6 +43,7 @@ struct ElementImpl //element tree stuff Element parent; std::map<std::string, Element> children; + Element *self; //things may be in this element boost::shared_ptr<Apology::Worker> worker; |