Cheetah Software  1.0
PeriodicTaskManager Class Reference

#include <PeriodicTask.h>

+ Collaboration diagram for PeriodicTaskManager:

Public Member Functions

 PeriodicTaskManager ()=default
 
 ~PeriodicTaskManager ()
 
void addTask (PeriodicTask *task)
 
void printStatus ()
 
void printStatusOfSlowTasks ()
 
void stopAll ()
 

Private Attributes

std::vector< PeriodicTask * > _tasks
 

Detailed Description

A collection of periodic tasks which can be monitored together

Definition at line 57 of file PeriodicTask.h.

Constructor & Destructor Documentation

PeriodicTaskManager::PeriodicTaskManager ( )
default
PeriodicTaskManager::~PeriodicTaskManager ( )

Definition at line 96 of file PeriodicTask.cpp.

96 {}

Member Function Documentation

void PeriodicTaskManager::addTask ( PeriodicTask task)

Definition at line 98 of file PeriodicTask.cpp.

98  {
99  _tasks.push_back(task);
100 }
std::vector< PeriodicTask * > _tasks
Definition: PeriodicTask.h:67

+ Here is the caller graph for this function:

void PeriodicTaskManager::printStatus ( )

Definition at line 102 of file PeriodicTask.cpp.

102  {
103  printf("\n----------------------------TASKS----------------------------\n");
104  printf("|%-20s|%-6s|%-6s|%-6s|%-6s|%-6s\n", "name", "rt", "rt-max", "T-des",
105  "T-act", "T-max");
106  printf("-----------------------------------------------------------\n");
107  for (auto& task : _tasks) {
108  task->printStatus();
109  task->clearMax();
110  }
111  printf("-------------------------------------------------------------\n\n");
112 }
std::vector< PeriodicTask * > _tasks
Definition: PeriodicTask.h:67
void PeriodicTaskManager::printStatusOfSlowTasks ( )

Definition at line 114 of file PeriodicTask.cpp.

114  {
115  for (auto& task : _tasks) {
116  if (task->isSlow()) {
117  task->printStatus();
118  task->clearMax();
119  }
120  }
121 }
std::vector< PeriodicTask * > _tasks
Definition: PeriodicTask.h:67
void PeriodicTaskManager::stopAll ( )

Definition at line 123 of file PeriodicTask.cpp.

123  {
124  for (auto& task : _tasks) {
125  task->stop();
126  }
127 }
std::vector< PeriodicTask * > _tasks
Definition: PeriodicTask.h:67

+ Here is the caller graph for this function:

Member Data Documentation

std::vector<PeriodicTask*> PeriodicTaskManager::_tasks
private

Definition at line 67 of file PeriodicTask.h.


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