summaryrefslogtreecommitdiff
path: root/lib/callable.cpp
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/callable.cpp
parenta8f263d94f8eb772a3a334aa5bb08c6e30b996ec (diff)
downloadsandhi-e2a237e121edfb53378ae57d8faa71491d0f29f1.tar.gz
sandhi-e2a237e121edfb53378ae57d8faa71491d0f29f1.tar.bz2
sandhi-e2a237e121edfb53378ae57d8faa71491d0f29f1.zip
gras: renamed key to name for clarity
Diffstat (limited to 'lib/callable.cpp')
-rw-r--r--lib/callable.cpp24
1 files changed, 12 insertions, 12 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)