diff options
author | Josh Blum | 2013-07-06 17:02:24 -0700 |
---|---|---|
committer | Josh Blum | 2013-07-06 17:02:24 -0700 |
commit | c6f6b12bf8429325407ae76f7ead8d3d72232f99 (patch) | |
tree | 6eb92f4630c4e911efa48d239a372b148c5e5e44 /lib | |
parent | 9ab885db8eb80c4046af20e1a361b304b5478686 (diff) | |
download | sandhi-c6f6b12bf8429325407ae76f7ead8d3d72232f99.tar.gz sandhi-c6f6b12bf8429325407ae76f7ead8d3d72232f99.tar.bz2 sandhi-c6f6b12bf8429325407ae76f7ead8d3d72232f99.zip |
gras: locate_element since now elements have calls
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; |