|
Sylib
A C++ Library For V5
|
Sylib System Daemon. More...
#include <system.hpp>
Public Member Functions | |
| void | startSylibDaemon () |
| Starts the Sylib daemon. This should be called in initialize() or pre_auton() More... | |
Static Public Member Functions | |
| static SylibDaemon & | getInstance () |
| Gets the single existing SylibDaemon object, or creates it if it doesn't exist yet. More... | |
| static SylibDaemon & | getInstanceUnsafe () |
| Gets the single existing SylibDaemon object, or creates it if it doesn't exist yet. More... | |
| static int | managerTaskFunction () |
| The sole function that runs inside a task made specifically for the Sylib daemon. Contains an infinite loop that will prevent anything else from happening in the thread this is called in. More... | |
| static int | createSubTask (sylib::Device *objectPointerToSchedule) |
| Adds a Device object or one of its child classes to the daemon's list of objects which need periodic updating. More... | |
| static int | createSubTaskUnsafe (sylib::Device *objectPointerToSchedule) |
| Adds a Device object or one of its child classes to the daemon's list of objects which need periodic updating. More... | |
| static void | removeSubTask (sylib::Device *objectPointerToSchedule) |
| Removes a Device object or one of its child classes from the daemon's list of objects which need periodic updating. More... | |
| static void | removeSubTaskByID (int idToKill) |
| Removes a subtask from the daemon's list of objects which need periodic updating. More... | |
| static uint64_t | getFrameCount () |
| Gets the number of ticks of the Sylib daemon update loop. More... | |
Static Public Attributes | |
| static sylib::Mutex | mutex |
| Mutex to prevent multiple threads from performing operations on important system things at once. More... | |
Sylib System Daemon.
This is a singleton this is created when the first object that needs it is.
Takes care of running update functions that need to happen periodically.
|
static |
|
static |
Adds a Device object or one of its child classes to the daemon's list of objects which need periodic updating.
Doesn't lock the mutex. This is used when creating objects in a global scope, before RTOS stuff has initialized and mutexes work.
| objectPointerToSchedule | A pointer to a Device object |
|
static |
Gets the number of ticks of the Sylib daemon update loop.
Should be approximately equal to the system timer divided by 2
|
static |
Gets the single existing SylibDaemon object, or creates it if it doesn't exist yet.
|
static |
Gets the single existing SylibDaemon object, or creates it if it doesn't exist yet.
Doesn't lock the mutex. This is used when creating objects in a global scope, before RTOS stuff has initialized and mutexes work.
|
static |
The sole function that runs inside a task made specifically for the Sylib daemon. Contains an infinite loop that will prevent anything else from happening in the thread this is called in.
|
static |
|
static |
Removes a subtask from the daemon's list of objects which need periodic updating.
| idToKill | The ID number of the subtask to remove |
| void sylib::SylibDaemon::startSylibDaemon | ( | ) |
Starts the Sylib daemon. This should be called in initialize() or pre_auton()
|
static |
Mutex to prevent multiple threads from performing operations on important system things at once.