Manages a set of callbacks for nodes' trigger ports.
It's safe for multiple threads to call addTrigger(), removeTrigger(), size(), and fire() on the same set.
Definition at line 21 of file VuoTriggerSet.hh.
Public Types | |
typedef void(* | TriggerFunctionType) (TriggerDataType) |
A node's trigger method. More... | |
Public Member Functions | |
VuoTriggerSet () | |
Creates a new trigger set. More... | |
~VuoTriggerSet () | |
Destroys the trigger set. More... | |
void | addTrigger (TriggerFunctionType trigger) |
Adds a trigger method to the trigger set. More... | |
void | addTrigger (TriggerFunctionType trigger, TriggerContextType context) |
Adds a trigger method, with caller-defined context data, to the trigger set. More... | |
void | removeTrigger (TriggerFunctionType trigger) |
Removes a trigger method from the trigger set. More... | |
unsigned int | size (void) |
Returns the number of triggers in the trigger set. More... | |
void | fire (TriggerDataType data) |
Fires the contextless triggers in the trigger set, passing them data . More... | |
void | fire (void(^)(TriggerFunctionType trigger, TriggerContextType context)) |
Fires the context-having triggers in the trigger set, passing them data . More... | |
typedef void(* VuoTriggerSet< TriggerDataType, TriggerContextType >::TriggerFunctionType) (TriggerDataType) |
A node's trigger method.
Definition at line 25 of file VuoTriggerSet.hh.
VuoTriggerSet< TriggerDataType, TriggerContextType >::VuoTriggerSet |
Creates a new trigger set.
Definition at line 48 of file VuoTriggerSet.hh.
VuoTriggerSet< TriggerDataType, TriggerContextType >::~VuoTriggerSet |
Destroys the trigger set.
Definition at line 57 of file VuoTriggerSet.hh.
void VuoTriggerSet< TriggerDataType, TriggerContextType >::addTrigger | ( | TriggerFunctionType | trigger | ) |
Adds a trigger method to the trigger set.
This function may be called from any thread.
Definition at line 70 of file VuoTriggerSet.hh.
void VuoTriggerSet< TriggerDataType, TriggerContextType >::addTrigger | ( | TriggerFunctionType | trigger, |
TriggerContextType | context | ||
) |
Adds a trigger method, with caller-defined context data, to the trigger set.
This function may be called from any thread.
Definition at line 83 of file VuoTriggerSet.hh.
void VuoTriggerSet< TriggerDataType, TriggerContextType >::fire | ( | TriggerDataType | data | ) |
Fires the contextless triggers in the trigger set, passing them data
.
This function may be called from any thread.
Definition at line 130 of file VuoTriggerSet.hh.
void VuoTriggerSet< TriggerDataType, TriggerContextType >::fire | ( | void(^)(TriggerFunctionType trigger, TriggerContextType context) | block | ) |
Fires the context-having triggers in the trigger set, passing them data
.
This function may be called from any thread.
Definition at line 144 of file VuoTriggerSet.hh.
void VuoTriggerSet< TriggerDataType, TriggerContextType >::removeTrigger | ( | TriggerFunctionType | trigger | ) |
Removes a trigger method from the trigger set.
This function may be called from any thread.
Definition at line 96 of file VuoTriggerSet.hh.
unsigned int VuoTriggerSet< TriggerDataType, TriggerContextType >::size | ( | void | ) |
Returns the number of triggers in the trigger set.
This function may be called from any thread.
Definition at line 115 of file VuoTriggerSet.hh.