Public Member Functions | Private Attributes | List of all members
bota_worker::WorkerManager Class Reference

#include <WorkerManager.hpp>

Public Member Functions

template<class T >
bool addWorker (const std::string &name, const double timestep, bool(T::*fp)(const WorkerEvent &), T *obj, const int priority=0, const bool autostart=true)
 
template<class T >
bool addWorker (const std::string &name, const double timestep, bool(T::*cfp)(const WorkerEvent &), void(T::*rfp)(), T *obj, const int priority=0, const bool autostart=true)
 
bool addWorker (const std::string &name, const double timestep, const WorkerCallback &callback, const int priority=0, const bool autostart=true)
 
bool addWorker (const std::string &name, const double timestep, const WorkerCallback &callback, const WorkerCallbackFailureReaction &callbackFailureReaction, const int priority=0, const bool autostart=true)
 
bool addWorker (const WorkerOptions &options, const bool autostart=true)
 
void cancelWorker (const std::string &name, const bool wait=true)
 
void cancelWorkers (const bool wait=true)
 
void cleanDestructibleWorkers ()
 
bool hasWorker (const std::string &name)
 
void setWorkerTimestep (const std::string &name, const double timeStep)
 
void startWorker (const std::string &name, const int priority=0)
 
void startWorkers ()
 
void stopWorker (const std::string &name, const bool wait=true)
 
void stopWorkers (const bool wait=true)
 
 WorkerManager ()
 
virtual ~WorkerManager ()
 

Private Attributes

std::mutex mutexWorkers_
 
std::unordered_map< std::string, Workerworkers_
 

Detailed Description

Definition at line 19 of file WorkerManager.hpp.

Constructor & Destructor Documentation

bota_worker::WorkerManager::WorkerManager ( )

Definition at line 11 of file WorkerManager.cpp.

bota_worker::WorkerManager::~WorkerManager ( )
virtual

Definition at line 15 of file WorkerManager.cpp.

Member Function Documentation

template<class T >
bool bota_worker::WorkerManager::addWorker ( const std::string &  name,
const double  timestep,
bool(T::*)(const WorkerEvent &)  fp,
T *  obj,
const int  priority = 0,
const bool  autostart = true 
)
inline

Definition at line 26 of file WorkerManager.hpp.

template<class T >
bool bota_worker::WorkerManager::addWorker ( const std::string &  name,
const double  timestep,
bool(T::*)(const WorkerEvent &)  cfp,
void(T::*)()  rfp,
T *  obj,
const int  priority = 0,
const bool  autostart = true 
)
inline

Definition at line 33 of file WorkerManager.hpp.

bool bota_worker::WorkerManager::addWorker ( const std::string &  name,
const double  timestep,
const WorkerCallback callback,
const int  priority = 0,
const bool  autostart = true 
)
inline

Definition at line 41 of file WorkerManager.hpp.

bool bota_worker::WorkerManager::addWorker ( const std::string &  name,
const double  timestep,
const WorkerCallback callback,
const WorkerCallbackFailureReaction callbackFailureReaction,
const int  priority = 0,
const bool  autostart = true 
)
inline

Definition at line 47 of file WorkerManager.hpp.

bool bota_worker::WorkerManager::addWorker ( const WorkerOptions options,
const bool  autostart = true 
)

Definition at line 20 of file WorkerManager.cpp.

void bota_worker::WorkerManager::cancelWorker ( const std::string &  name,
const bool  wait = true 
)

Definition at line 94 of file WorkerManager.cpp.

void bota_worker::WorkerManager::cancelWorkers ( const bool  wait = true)

Requests all workers to stop, then joins their threads and deletes their instances.

Definition at line 107 of file WorkerManager.cpp.

void bota_worker::WorkerManager::cleanDestructibleWorkers ( )

Removes workers which are destructible (see Worker::isDestructible()) from the map (calling their destructors)

Definition at line 133 of file WorkerManager.cpp.

bool bota_worker::WorkerManager::hasWorker ( const std::string &  name)

Definition at line 88 of file WorkerManager.cpp.

void bota_worker::WorkerManager::setWorkerTimestep ( const std::string &  name,
const double  timeStep 
)

Definition at line 121 of file WorkerManager.cpp.

void bota_worker::WorkerManager::startWorker ( const std::string &  name,
const int  priority = 0 
)

Definition at line 46 of file WorkerManager.cpp.

void bota_worker::WorkerManager::startWorkers ( )

Definition at line 58 of file WorkerManager.cpp.

void bota_worker::WorkerManager::stopWorker ( const std::string &  name,
const bool  wait = true 
)

Definition at line 67 of file WorkerManager.cpp.

void bota_worker::WorkerManager::stopWorkers ( const bool  wait = true)

Definition at line 79 of file WorkerManager.cpp.

Member Data Documentation

std::mutex bota_worker::WorkerManager::mutexWorkers_
private

Definition at line 88 of file WorkerManager.hpp.

std::unordered_map<std::string, Worker> bota_worker::WorkerManager::workers_
private

Definition at line 87 of file WorkerManager.hpp.


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


bota_worker
Author(s):
autogenerated on Wed Mar 3 2021 03:09:10