◆ FreeRunningRepeatingTask()
| FreeRunningRepeatingTask::FreeRunningRepeatingTask |
( |
std::string |
threadName, |
|
|
int |
priority = 1 |
|
) |
| |
This is the default constructor for the class.
- Parameters
-
| threadName | This is the name of the thread in a human readable format. |
| priority | This is the priority for the task. |
This is the default constructor for the class.
- Parameters
-
| threadName | This is the name of the thread in a human readable format. |
| period | This is the period for the task, given in microseconds. Must be at least 100 microseconds. |
◆ ~FreeRunningRepeatingTask()
| FreeRunningRepeatingTask::~FreeRunningRepeatingTask |
( |
| ) |
|
|
virtual |
This method will clean up from the periodic task and its execution.
Nothing to be done in the destructor.
◆ getCPUUsageInfo()
| double FreeRunningRepeatingTask::getCPUUsageInfo |
( |
| ) |
|
|
virtual |
This method will obtain the CPU usage. CPU usage is the worst case measured execution time divided by the period.
- Returns
- The CPU usage will be returned.
Reimplemented from SWE4211RPi::RunnableClass.
◆ invokeRun()
| void SWE4211RPi::FreeRunningRepeatingTask::invokeRun |
( |
| ) |
|
|
private |
This is a private method that will be used by start to invoke the run method.
◆ printInformation()
| void FreeRunningRepeatingTask::printInformation |
( |
| ) |
|
|
virtual |
This method will print out information about the given thread. The info will be dependent upon the given thread.
Reimplemented from SWE4211RPi::RunnableClass.
◆ resetThreadDiagnostics()
| void FreeRunningRepeatingTask::resetThreadDiagnostics |
( |
| ) |
|
|
virtual |
This method will reset thread diagnostics back to their default values. The wall times and CPU times will be set to 0.
This method will reset thread diagnostics back to their default values.
Reimplemented from SWE4211RPi::RunnableClass.
◆ run()
| void FreeRunningRepeatingTask::run |
( |
| ) |
|
|
finalvirtual |
This is the run method for the class.
This is a private method that will be used by start to invoke the run method.
Set keep going to be true, to indicate that the thread is to continue running.
The following gets the wall time, for determining next execution time.
Obtain the cpu time at the start of this periodic task. This is for CPU time measurement.
Now run the task. Call the task method.
Now get the end CPU time entry.
Determine where we are in terms of the worst case execution time.
Implements SWE4211RPi::RunnableClass.
◆ startChildRunnables()
| void FreeRunningRepeatingTask::startChildRunnables |
( |
| ) |
|
|
finalprotectedvirtual |
This method will start up any runnable objects which are contained within a class that implements the RUnnable interface. If there are no other objects that are runnable, there is no need to override this method. However, if a child class contains an instance of a runnable object, then this method must be overridden in the derived class.
Reimplemented from SWE4211RPi::RunnableClass.
◆ startChildTasks()
| void FreeRunningRepeatingTask::startChildTasks |
( |
| ) |
|
|
protectedvirtual |
This method will start up any runnable objects which are contained within a class that implements the RUnnable interface. If there are no other objects that are runnable, there is no need to override this method. However, if a child class contains an instance of a runnable object, then this method must be overridden in the derived class.
◆ stopChildRunnables()
| void FreeRunningRepeatingTask::stopChildRunnables |
( |
| ) |
|
|
finalprotectedvirtual |
This method will stop any runnable objects which are contained within a class that implements the Runnable interface. If there are no other objects that are runnable, there is no need to override this method. However, if a child class contains an instance of a runnable object, then this method must be overridden in the derived class.
Reimplemented from SWE4211RPi::RunnableClass.
◆ stopChildTasks()
| void FreeRunningRepeatingTask::stopChildTasks |
( |
| ) |
|
|
protectedvirtual |
This method will stop any runnable objects which are contained within a class that implements the RUnnable interface. If there are no other objects that are runnable, there is no need to override this method. However, if a child class contains an instance of a runnable object, then this method must be overridden in the derived class.
◆ taskMethod()
| virtual void SWE4211RPi::FreeRunningRepeatingTask::taskMethod |
( |
| ) |
|
|
pure virtual |
This is the task method. The task method will be invoked periodically every taskPeriod units of time, where the period is set by an existing piece of hardware.
◆ lastExecutionTime
| long SWE4211RPi::FreeRunningRepeatingTask::lastExecutionTime = 0 |
|
private |
This variable holds the last execution value for the CPU, showing the time it took to execute.
◆ lastWallTime
| long SWE4211RPi::FreeRunningRepeatingTask::lastWallTime = 0 |
|
private |
This variable holds the last wall time measurement for the given periodic task. The wall time is the time from the start to the end of the task running.
◆ missedDeadlineCount
| long SWE4211RPi::FreeRunningRepeatingTask::missedDeadlineCount = 0 |
|
private |
This variable will hold the count as to how many times the deadline was missed for the given system.
◆ worstCaseExecutionTime
| long SWE4211RPi::FreeRunningRepeatingTask::worstCaseExecutionTime = 0 |
|
private |
This variable stores the worst case execution time from a CPU time standpoint.
◆ worstCaseWallTime
| long SWE4211RPi::FreeRunningRepeatingTask::worstCaseWallTime = 0 |
|
private |
This variable holds the worst case wall time. This is the worst case from start to finish of the given periodic task.
The documentation for this class was generated from the following files:
- /media/sf_lwshare/20262027SWE4211AllLabSolutions/Lab5/samplesolution/PiCode/src/tasking/provided/FreeRunningRepeatingTask.h
- /media/sf_lwshare/20262027SWE4211AllLabSolutions/Lab5/samplesolution/PiCode/src/tasking/provided/FreeRunningRepeatingTask.cpp