Terminus
Public Types | Public Member Functions | Protected Attributes | List of all members
terminus::ActionScheduler Class Reference

The ActionScheduler class maintains a list of actions, that should be executed later in a specific context. More...

#include <actionscheduler.h>

Public Types

using Action = std::function< bool(void)>
 functions that can be stored as actions can not have parameters and must return a bool whether they should be scheduled again More...
 

Public Member Functions

 ActionScheduler ()
 
void scheduleAction (const Action &action)
 add an Action to the action list More...
 
void executeActions ()
 execute all Actions currently contained in the action list and possibly schedule them again More...
 

Protected Attributes

int m_currentActionList
 
std::vector< Actionm_actionList [2]
 
std::recursive_mutex m_actionListMutex
 

Detailed Description

The ActionScheduler class maintains a list of actions, that should be executed later in a specific context.

This class can be safely used across multiple threads.

Member Typedef Documentation

using terminus::ActionScheduler::Action = std::function<bool(void)>

functions that can be stored as actions can not have parameters and must return a bool whether they should be scheduled again

Constructor & Destructor Documentation

terminus::ActionScheduler::ActionScheduler ( )

Member Function Documentation

void terminus::ActionScheduler::executeActions ( )

execute all Actions currently contained in the action list and possibly schedule them again

void terminus::ActionScheduler::scheduleAction ( const Action action)

add an Action to the action list

Parameters
event

Member Data Documentation

std::vector<Action> terminus::ActionScheduler::m_actionList[2]
protected
std::recursive_mutex terminus::ActionScheduler::m_actionListMutex
protected
int terminus::ActionScheduler::m_currentActionList
protected

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