|
TR-mbed 1.0
|
#include <TRMutex.h>
Public Member Functions | |
| TRMutex () | |
| void | updatePriority (priorityLevels desiredLevel) |
| void | print (int integer, priorityLevels priority) |
| void | print (char statement[], priorityLevels priority) |
| void | println (int integer, priorityLevels priority) |
| void | println (char statement[], priorityLevels priority) |
| void | printff (const char *format, priorityLevels priority,...) |
Static Public Member Functions | |
| static void | loop () |
Public Attributes | |
| Thread | print_code_thread |
| priorityLevels | priorityIndicator |
The TRMutex class defines the use of printing through Mutex and threading. This class contains methods that can be used in place of print statements for better efficiency.
| TRMutex::TRMutex | ( | ) |
Constructor for creating a TRMutex object. By calling the constructor, the thread above automatically begins running.
|
static |
Loop running within the thread called by the TRMutex constructor.
| void TRMutex::print | ( | char | statement[], |
| priorityLevels | priority | ||
| ) |
Method to print string arguments with no newline at the end.
| string | to print |
| enum | of print priority level |
| void TRMutex::print | ( | int | integer, |
| priorityLevels | priority | ||
| ) |
Method to print integer arguments with no newline at the end.
| integer | to print |
| enum | of print priority level |
| void TRMutex::printff | ( | const char * | format, |
| priorityLevels | priority, | ||
| ... | |||
| ) |
Method that mimics the printf() functionality
| string | that contains the formatting desired. (eg. d, s etc.) |
| enum | of print priority level |
| arguments | to be formatted |
| void TRMutex::println | ( | char | statement[], |
| priorityLevels | priority | ||
| ) |
Method to print string arguments with a newline at the end.
| string | to print |
| enum | of print priority level |
| void TRMutex::println | ( | int | integer, |
| priorityLevels | priority | ||
| ) |
Method to print integer arguments with a newline at the end.
| integer | to print |
| enum | of print priority level |
| void TRMutex::updatePriority | ( | priorityLevels | desiredLevel | ) |
Method to change priority level to determine which print statements will happen
| enum | of priority level desired |
| Thread TRMutex::print_code_thread |
Creates a thread which will be running alongside robot code, simultaneously printing data when methods from TRMutex are called.
| priorityLevels TRMutex::priorityIndicator |
int storing priorityIndicator