Fawkes API  Fawkes Development Version
fawkes::LuaTriggerManager Class Reference

Lua Trigger Manager. More...

#include <>>

Public Member Functions

 LuaTriggerManager (LuaContext *lua, const char *trigger_var)
 Constructor. More...
 
 ~LuaTriggerManager ()
 Destructor. More...
 
void trigger (const char *event, const char *param_format=0,...)
 Cause a trigger event. More...
 

Detailed Description

Lua Trigger Manager.

This class interfaces with a trigger sub-system running inside Lua (with the trigger system provided by Fawkes' Lua packages).

Author
Tim Niemueller

Definition at line 30 of file trigger.h.

Constructor & Destructor Documentation

◆ LuaTriggerManager()

fawkes::LuaTriggerManager::LuaTriggerManager ( LuaContext lua,
const char *  trigger_var 
)

Constructor.

Parameters
luaLua context to use that has a running trigger system
trigger_varthe name of the (global) variable pointing to the trigger system

Definition at line 46 of file trigger.cpp.

◆ ~LuaTriggerManager()

fawkes::LuaTriggerManager::~LuaTriggerManager ( )

Destructor.

Definition at line 54 of file trigger.cpp.

Member Function Documentation

◆ trigger()

void fawkes::LuaTriggerManager::trigger ( const char *  event,
const char *  param_format = 0,
  ... 
)

Cause a trigger event.

Parameters
eventname of the event to trigger
param_formata format string for a string passed plain as Lua code in the trigger() function call as second argument. The code executed looks like "lua_trigger_var:trigger(event, string)" with string being what you pass, so it can be any number of arguments, for instance you could pass
{x=%f, y=%f}
which would result in a table set with the two floats you provide in the ellipsis.

Definition at line 73 of file trigger.cpp.

References fawkes::LuaContext::do_string().


The documentation for this class was generated from the following files: