Renamed "hooks" to "methods".

This commit is contained in:
Gunnar Beutner 2012-07-16 08:19:51 +02:00
parent 8e118983be
commit 7270fb160c
5 changed files with 9 additions and 9 deletions

View File

@ -197,12 +197,12 @@ void ConfigObject::RemoveTag(const string& key)
GetTags()->Remove(key);
}
ScriptTask::Ptr ConfigObject::InvokeHook(const string& hook,
ScriptTask::Ptr ConfigObject::InvokeMethod(const string& method,
const vector<Variant>& arguments, ScriptTask::CompletionCallback callback)
{
Dictionary::Ptr hooks;
Dictionary::Ptr methods;
string funcName;
if (!GetProperty("hooks", &hooks) || !hooks->Get(hook, &funcName))
if (!GetProperty("methods", &methods) || !methods->Get(method, &funcName))
return ScriptTask::Ptr();
ScriptFunction::Ptr func = ScriptFunction::GetByName(funcName);

View File

@ -65,7 +65,7 @@ public:
void RemoveTag(const string& key);
ScriptTask::Ptr InvokeHook(const string& hook,
ScriptTask::Ptr InvokeMethod(const string& hook,
const vector<Variant>& arguments, ScriptTask::CompletionCallback callback);
string GetType(void) const;

View File

@ -46,8 +46,8 @@ void ConfigObjectAdapter::RemoveTag(const string& key)
m_ConfigObject->RemoveTag(key);
}
ScriptTask::Ptr ConfigObjectAdapter::InvokeHook(const string& hook,
ScriptTask::Ptr ConfigObjectAdapter::InvokeMethod(const string& method,
const vector<Variant>& arguments, ScriptTask::CompletionCallback callback)
{
return m_ConfigObject->InvokeHook(hook, arguments, callback);
}
return m_ConfigObject->InvokeMethod(method, arguments, callback);
}

View File

@ -57,7 +57,7 @@ public:
void RemoveTag(const string& key);
ScriptTask::Ptr InvokeHook(const string& hook,
ScriptTask::Ptr InvokeMethod(const string& method,
const vector<Variant>& arguments, ScriptTask::CompletionCallback callback);
private:

View File

@ -79,7 +79,7 @@ void CheckerComponent::CheckTimerHandler(void)
vector<Variant> arguments;
arguments.push_back(service.GetConfigObject());
ScriptTask::Ptr task;
task = service.InvokeHook("check", arguments, boost::bind(&CheckerComponent::CheckCompletedHandler, this, service, _1));
task = service.InvokeMethod("check", arguments, boost::bind(&CheckerComponent::CheckCompletedHandler, this, service, _1));
assert(task); /* TODO: gracefully handle missing hooks */
m_PendingServices.insert(service.GetConfigObject());