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

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

Inheritance diagram for arpirobot::ActionSeries:
arpirobot::Action

Public Member Functions

 ActionSeries (std::vector< std::reference_wrapper< Action >> actions, Action &finishedAction)
 
 ActionSeries (std::vector< std::shared_ptr< Action >> actions, Action &finishedAction)
 
 ActionSeries (std::vector< std::reference_wrapper< Action >> actions, std::shared_ptr< Action > finishedAction)
 
 ActionSeries (std::vector< std::shared_ptr< Action >> actions, std::shared_ptr< Action > finishedAction)
 
- Public Member Functions inherited from arpirobot::Action
 Action (int32_t processRateMs=-1)
 
bool isRunning ()
 
int32_t getProcessPeriodMs ()
 
void setProcessPeriodMs (int32_t processPeriodMs)
 

Protected Member Functions

LockedDeviceList lockedDevices () override
 
void begin () override
 
void process () override
 
void finish (bool interrupted) override
 
bool shouldContinue () override
 

Detailed Description

A special action that will run a sequential set of actions (one at a time)

Constructor & Destructor Documentation

◆ ActionSeries() [1/4]

arpirobot::ActionSeries::ActionSeries ( std::vector< std::reference_wrapper< Action >>  actions,
Action finishedAction 
)
Parameters
actionsA vector of actions to run sequentially (actions must remain in scope for lifetime of ActionSeries)
finishedActionAn action to transition to once other actions are complete (must remain in scope)

◆ ActionSeries() [2/4]

arpirobot::ActionSeries::ActionSeries ( std::vector< std::shared_ptr< Action >>  actions,
Action finishedAction 
)
Parameters
actionsA vector of actions to run sequentially (shared_ptrs to can use std::make_shared)
finishedActionAn action to transition to once other actions are complete (must remain in scope)

◆ ActionSeries() [3/4]

arpirobot::ActionSeries::ActionSeries ( std::vector< std::reference_wrapper< Action >>  actions,
std::shared_ptr< Action finishedAction 
)
Parameters
actionsA vector of actions to run sequentially (actions must remain in scope for lifetime of ActionSeries)
finishedActionAn action to transition to once other actions are complete (can use std::make_shared)

◆ ActionSeries() [4/4]

arpirobot::ActionSeries::ActionSeries ( std::vector< std::shared_ptr< Action >>  actions,
std::shared_ptr< Action finishedAction 
)
Parameters
actionsA vector of actions to run sequentially (shared_ptrs to can use std::make_shared)
finishedActionAn action to transition to once other actions are complete (can use std::make_shared)

Member Function Documentation

◆ begin()

void arpirobot::ActionSeries::begin ( )
overrideprotectedvirtual

Run when the action is started.

Implements arpirobot::Action.

◆ finish()

void arpirobot::ActionSeries::finish ( bool  wasInterrupted)
overrideprotectedvirtual

Run when the action is stopped.

Parameters
wasInterruptedWill be true if the action did not stop on its own (see Action::shouldContinue)

Implements arpirobot::Action.

◆ process()

void arpirobot::ActionSeries::process ( )
overrideprotectedvirtual

Run periodically after the action is started, but before it finishes.

Implements arpirobot::Action.

◆ shouldContinue()

bool arpirobot::ActionSeries::shouldContinue ( )
overrideprotectedvirtual

Called each time after Action::process. When this returns false the action will stop.

Returns
false if the action should stop. Else true.

Implements arpirobot::Action.


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