summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJosh Blum2013-07-07 10:09:50 -0700
committerJosh Blum2013-07-07 10:09:50 -0700
commite2a237e121edfb53378ae57d8faa71491d0f29f1 (patch)
tree24ebeef084285617be5e0a90857880c6bf071ff5 /lib
parenta8f263d94f8eb772a3a334aa5bb08c6e30b996ec (diff)
downloadsandhi-e2a237e121edfb53378ae57d8faa71491d0f29f1.tar.gz
sandhi-e2a237e121edfb53378ae57d8faa71491d0f29f1.tar.bz2
sandhi-e2a237e121edfb53378ae57d8faa71491d0f29f1.zip
gras: renamed key to name for clarity
Diffstat (limited to 'lib')
-rw-r--r--lib/callable.cpp24
-rw-r--r--lib/top_block_query.cpp2
2 files changed, 13 insertions, 13 deletions
diff --git a/lib/callable.cpp b/lib/callable.cpp
index f52d604..af27399 100644
--- a/lib/callable.cpp
+++ b/lib/callable.cpp
@@ -21,35 +21,35 @@ Callable::~Callable(void)
_call_registry.reset();
}
-std::vector<std::string> Callable::get_registered_keys(void) const
+std::vector<std::string> Callable::get_registered_names(void) const
{
CallableRegistry *cr = reinterpret_cast<CallableRegistry *>(_call_registry.get());
- std::vector<std::string> keys;
+ std::vector<std::string> names;
BOOST_FOREACH(const CallableRegistryPair &p, (*cr))
{
- keys.push_back(p.first);
+ names.push_back(p.first);
}
- return keys;
+ return names;
}
-void Callable::unregister_call(const std::string &key)
+void Callable::unregister_call(const std::string &name)
{
CallableRegistry *cr = reinterpret_cast<CallableRegistry *>(_call_registry.get());
- if (cr->count(key) == 0) throw std::invalid_argument("Callable - no method registered for key: " + key);
- cr->erase(key);
+ if (cr->count(name) == 0) throw std::invalid_argument("Callable - no method registered for name: " + name);
+ cr->erase(name);
}
-void Callable::_register_call(const std::string &key, void *entry)
+void Callable::_register_call(const std::string &name, void *entry)
{
CallableRegistry *cr = reinterpret_cast<CallableRegistry *>(_call_registry.get());
- (*cr)[key].reset(reinterpret_cast<CallableRegistryEntry *>(entry));
+ (*cr)[name].reset(reinterpret_cast<CallableRegistryEntry *>(entry));
}
-PMCC Callable::_handle_call(const std::string &key, const PMCC &args)
+PMCC Callable::_handle_call(const std::string &name, const PMCC &args)
{
CallableRegistry *cr = reinterpret_cast<CallableRegistry *>(_call_registry.get());
- if (cr->count(key) == 0) throw std::invalid_argument("Callable - no method registered for key: " + key);
- return (*cr)[key]->call(args);
+ if (cr->count(name) == 0) throw std::invalid_argument("Callable - no method registered for name: " + name);
+ return (*cr)[name]->call(args);
}
CallableRegistryEntry::CallableRegistryEntry(void)
diff --git a/lib/top_block_query.cpp b/lib/top_block_query.cpp
index ee9d234..8be8419 100644
--- a/lib/top_block_query.cpp
+++ b/lib/top_block_query.cpp
@@ -36,7 +36,7 @@ static ptree query_blocks(ElementImpl *self, const ptree &)
{
BlockActor *actor = dynamic_cast<BlockActor *>(w->get_actor());
ptree prop_e;
- BOOST_FOREACH(const std::string &key, actor->data->block->get_registered_keys())
+ BOOST_FOREACH(const std::string &key, actor->data->block->get_registered_names())
{
ptree pname; pname.put_value(key);
prop_e.push_back(std::make_pair("call", pname));