ArPiRobot-CoreLib C++
C++ library for ArPiRobot robots
Static Public Member Functions | Friends | List of all members
arpirobot::ActionManager Class Reference

#include <arpirobot/core/action/ActionManager.hpp>

Static Public Member Functions

static bool startAction (Action &action, bool doRestart=true)
 
static bool startAction (std::shared_ptr< Action > action, bool doRestart=true)
 
static bool stopAction (Action &action)
 
static bool stopAction (std::shared_ptr< Action > action)
 
static void addTrigger (BaseActionTrigger &trigger)
 
static void addTrigger (std::shared_ptr< BaseActionTrigger > trigger)
 
static void removeTrigger (BaseActionTrigger &trigger)
 
static void removeTrigger (std::shared_ptr< BaseActionTrigger > trigger)
 

Friends

class BaseRobot
 
class Action
 
class ActionSeries
 

Detailed Description

Static helper class to manage actions and triggers

Member Function Documentation

◆ addTrigger() [1/2]

static void arpirobot::ActionManager::addTrigger ( BaseActionTrigger trigger)
static

Add a trigger to start an action when some event occurs.

Parameters
triggerA reference to trigger to add. Must remain in scope until removed.

◆ addTrigger() [2/2]

static void arpirobot::ActionManager::addTrigger ( std::shared_ptr< BaseActionTrigger trigger)
static

Add a trigger to start an action when some event occurs.

Parameters
triggerA shared_ptr to the trigger to add. Can use with std::make_shared

◆ removeTrigger() [1/2]

static void arpirobot::ActionManager::removeTrigger ( BaseActionTrigger trigger)
static

Remove a trigger

Parameters
triggerA reference to trigger to remove.

◆ removeTrigger() [2/2]

static void arpirobot::ActionManager::removeTrigger ( std::shared_ptr< BaseActionTrigger trigger)
static

Remove a trigger

Parameters
triggerA shared_ptr to the trigger to remove

◆ startAction() [1/2]

static bool arpirobot::ActionManager::startAction ( Action action,
bool  doRestart = true 
)
static

Start an action

Parameters
actionA reference to the action to start. Referenced action must remain in scope while action is running
doRestartIf true starting an action that is already running will restart the action. If false the action will continue running uninterrupted.
Returns
true if the action was started successfully

◆ startAction() [2/2]

static bool arpirobot::ActionManager::startAction ( std::shared_ptr< Action action,
bool  doRestart = true 
)
static

Start an action

Parameters
actionA shared_ptr to the action to start. Can use with std::make_shared
doRestartIf true starting an action that is already running will restart the action. If false the action will continue running uninterrupted.
Returns
true if the action was started successfully

◆ stopAction() [1/2]

static bool arpirobot::ActionManager::stopAction ( Action action)
static

Stop an action (interrupts it) If the action is not running nothing is done.

Parameters
actionA reference to the action to stop. Referenced action must remain in scope while action is running
Returns
true if the action was stopped. If false, the action was not running.

◆ stopAction() [2/2]

static bool arpirobot::ActionManager::stopAction ( std::shared_ptr< Action action)
static

Stop an action (interrupts it) If the action is not running nothing is done.

Parameters
actionA shared_ptr to the action to stop. Can use with std::make_shared
Returns
true if the action was stopped. If false, the action was not running.

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