24 if (!inserted_element.second)
31 return inserted_element.first->second.start();
52 ROS_ERROR(
"Cannot start worker [%s], worker not found", name.c_str());
55 worker->second.start(priority);
63 worker.second.start();
73 ROS_ERROR(
"Cannot stop worker [%s], worker not found", name.c_str());
76 worker->second.stop(wait);
84 worker.second.stop(wait);
100 ROS_ERROR(
"Cannot stop worker [%s], worker not found", name.c_str());
103 worker->second.stop(wait);
114 worker.second.stop(wait);
127 ROS_ERROR(
"Cannot change timestep of worker [%s], worker not found", name.c_str());
130 worker->second.setTimestep(timeStep);
138 if (it->second.isDestructible())
bool hasWorker(const std::string &name)
void cleanDestructibleWorkers()
void stopWorker(const std::string &name, const bool wait=true)
void setWorkerTimestep(const std::string &name, const double timeStep)
void stopWorkers(const bool wait=true)
std::unordered_map< std::string, Worker > workers_
void cancelWorkers(const bool wait=true)
void startWorker(const std::string &name, const int priority=0)
std::string name_
Name for printing.
bool addWorker(const std::string &name, const double timestep, bool(T::*fp)(const WorkerEvent &), T *obj, const int priority=0, const bool autostart=true)
void cancelWorker(const std::string &name, const bool wait=true)