Merge remote-tracking branch 'origin/topic/gilbert/plugin-api-tweak'

* origin/topic/gilbert/plugin-api-tweak:
  Updating plugin.hooks baseline so that test succeeds
  Revert spacing change that shouldn't have been included with the previous changeset ... should fix all of the plugin tests save hooks, which needs to be updated.
  More small fixes
  Small fixes
  Incremental
  Re-updating plugin.hooks test to include new argument output (after merge).
  Fixing logic errors in HandlePluginResult
  Updating tests and tweaking HookArgument to include Frame support.
  Incremental commit: implementing a wrapper for the Val class.
  Reverting change to const status of network_time.  Also, see FIXME: in Func.cc / HandlePluginResult ...
  Tweaks to result handling to make things a little more sane.
  Plugin API: minor change (adding parent frame) to support calling methods from hook.  Also declare network time update argument to be const because good practice.

BIT-1270 #merged

Conflicts:
	testing/btest/Baseline/plugins.hooks/output
This commit is contained in:
Robin Sommer 2015-03-02 18:07:17 -08:00
commit 6fa03abdbc
12 changed files with 1030 additions and 944 deletions

View file

@ -48,7 +48,7 @@ int Plugin::HookLoadFile(const std::string& file, const std::string& ext)
return -1;
}
Val* Plugin::HookCallFunction(const Func* func, val_list* args)
std::pair<bool, Val*> Plugin::HookCallFunction(const Func* func, Frame* frame, val_list* args)
{
ODesc d;
d.SetShort();
@ -57,7 +57,7 @@ Val* Plugin::HookCallFunction(const Func* func, val_list* args)
fprintf(stderr, "%.6f %-15s %s\n", network_time, "| HookCallFunction",
d.Description());
return 0;
return std::pair<bool, Val*>(false, NULL);
}
bool Plugin::HookQueueEvent(Event* event)

View file

@ -11,7 +11,7 @@ class Plugin : public ::plugin::Plugin
{
protected:
virtual int HookLoadFile(const std::string& file, const std::string& ext);
virtual Val* HookCallFunction(const Func* func, val_list* args);
virtual std::pair<bool, Val*> HookCallFunction(const Func* func, Frame* frame, val_list* args);
virtual bool HookQueueEvent(Event* event);
virtual void HookDrainEvents();
virtual void HookUpdateNetworkTime(double network_time);