summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Blum2013-03-22 02:50:46 -0700
committerJosh Blum2013-03-22 02:50:46 -0700
commit8cd3da02902c7071284d268b535f6fdf58bb8c3f (patch)
tree3142118d29f301683859773cc980c15846719f38
parent854cb19d99e8cce67fd30c5cfc78c02bbeb3bcd2 (diff)
downloadsandhi-8cd3da02902c7071284d268b535f6fdf58bb8c3f.tar.gz
sandhi-8cd3da02902c7071284d268b535f6fdf58bb8c3f.tar.bz2
sandhi-8cd3da02902c7071284d268b535f6fdf58bb8c3f.zip
gras: rename lookup to locate
-rw-r--r--include/gras/element.hpp4
-rw-r--r--lib/element.cpp2
-rw-r--r--tests/block_props_test.py12
3 files changed, 9 insertions, 9 deletions
diff --git a/include/gras/element.hpp b/include/gras/element.hpp
index 13ebb7c..633ab84 100644
--- a/include/gras/element.hpp
+++ b/include/gras/element.hpp
@@ -59,7 +59,7 @@ struct GRAS_API Element : ElementBase, boost::enable_shared_from_this<Element>
void adopt_element(const std::string &name, const Element &child);
/*!
- * Lookup a block in the element tree hierarchy.
+ * Locate a block in the element tree hierarchy.
*
* Paths are unix style, absolte and relatives paths are possible.
* This call throws an invalid argument when bad paths are given.
@@ -70,7 +70,7 @@ struct GRAS_API Element : ElementBase, boost::enable_shared_from_this<Element>
* \param path a path to a block (leaf) in the tree
* \return a pointer to the block
*/
- Block *lookup_block(const std::string &path);
+ Block *locate_block(const std::string &path);
/*******************************************************************
* Compatibility for dealing with shared ptrs of Elements
diff --git a/lib/element.cpp b/lib/element.cpp
index cc16fdf..4adc92c 100644
--- a/lib/element.cpp
+++ b/lib/element.cpp
@@ -71,7 +71,7 @@ void Element::adopt_element(const std::string &name, const Element &child)
(*this)->children[name] = child;
}
-Block *Element::lookup_block(const std::string &path)
+Block *Element::locate_block(const std::string &path)
{
//split the paths into nodes
std::vector<std::string> nodes;
diff --git a/tests/block_props_test.py b/tests/block_props_test.py
index b392693..bd8d53a 100644
--- a/tests/block_props_test.py
+++ b/tests/block_props_test.py
@@ -58,27 +58,27 @@ class BlockPropsTest(unittest.TestCase):
my_block.set("foo", 42)
self.assertEqual(my_block.get("foo"), 42)
- my_block0 = tb.lookup_block('/my_hier/my_block')
+ my_block0 = tb.locate_block('/my_hier/my_block')
self.assertEqual(my_block0.get("foo"), 42)
- my_block1 = hb.lookup_block('my_block')
+ my_block1 = hb.locate_block('my_block')
self.assertEqual(my_block1.get("foo"), 42)
- my_block2 = hb.lookup_block('./../my_hier/my_block')
+ my_block2 = hb.locate_block('./../my_hier/my_block')
self.assertEqual(my_block2.get("foo"), 42)
threw = False
- try: hb.lookup_block('../../my_hier/my_block')
+ try: hb.locate_block('../../my_hier/my_block')
except: threw = True
self.assertTrue(threw)
threw = False
- try: hb.lookup_block('../../my_hier/my_block0')
+ try: hb.locate_block('../../my_hier/my_block0')
except: threw = True
self.assertTrue(threw)
threw = False
- try: hb.lookup_block('../../my_hier/my_block/test')
+ try: hb.locate_block('../../my_hier/my_block/test')
except: threw = True
self.assertTrue(threw)