Components/Libraries/XF/FreeRTOS/Thread
Sara.chalokh (Talk | contribs) (→Parameters) |
Sara.chalokh (Talk | contribs) (→Parameters) |
||
(8 intermediate revisions by one user not shown) | |||
Line 36: | Line 36: | ||
== timeoutIndication(Event* opEv) == | == timeoutIndication(Event* opEv) == | ||
=== Description === | === Description === | ||
+ | This method is called by the timer manager when the the delay of an event ends | ||
+ | |||
=== Parameters === | === Parameters === | ||
+ | Event* '''opEv''' : the event whose the delay ends | ||
+ | |||
== void threadMain() == | == void threadMain() == | ||
=== Description === | === Description === | ||
+ | This is the main function of the thread. It get the first event of the event queue and dispatch it to the good state machine | ||
+ | |||
== void scheduleTimeout(Event* opEv) == | == void scheduleTimeout(Event* opEv) == | ||
=== Description === | === Description === | ||
+ | Call the timer manager to schedule a timeout for the delay of an event | ||
+ | |||
=== Parameters === | === Parameters === | ||
+ | Event* '''opEv''' : a pointer to the event that needs a delay | ||
+ | |||
== void dispatchEvent(Event* opEv) [virtual] == | == void dispatchEvent(Event* opEv) [virtual] == | ||
=== Description === | === Description === | ||
+ | The event to the good state machine to process it | ||
+ | |||
=== Parameters === | === Parameters === | ||
+ | Event* '''opEv''' : the event to dispatch | ||
+ | |||
== void deleteEvent(Event* opEv) == | == void deleteEvent(Event* opEv) == | ||
=== Description === | === Description === | ||
+ | Delete the given event | ||
+ | |||
=== Parameters === | === Parameters === | ||
+ | Event* '''opEv''' : the event to delete |
Latest revision as of 13:33, 21 August 2017
Thread
This class is the basic thread of the XFOS. It manages state machines, dispatch the events and schedule timeouts when an event need it. This class contains an event queue where a put events waiting for process.
Member Attributes
Queue _eventQueue : the event queue of the Thread
TimerManager* _pTimerManager : a pointer to the timer manager
Member Functions Documentation
Thread(TimerManager* opTimerManager, std::string oName, PRIORITY_SIZE oPriority, STACKSIZE_SIZE oStackDepth)
Description
The constructor of the Thread. It create the Thread and initialuîze the event queue.
Parameters
TimerManager* opTimerManager : a pointer to the timer manager
string oName : the name of the thread (basically set as "Event Dispatcher")
PRIORITY_SIZE oPriority : the priority of the thread
STACKSIZE_SIZE oStackDepth : the stack size of the thread (basically set as THREAD_STACK_SIZE)
~Thread() [virtual]
Description
The destructor of the Thread
void pushEvent(Event* opEv, timeSize oTimeToWait) [virtual]
Description
If the event to push has a delay of 0, this function add it in the event queue. If the event needs a delay, this function schedule a timeout to the TimerManager and don't add the event in the queue.
Parameters
Event* opEv : a pointer to the event to push
timeSize oTimeToWait : the time (in ms) to wait if event queue is full (basically set as INFINIT_TIME)
timeoutIndication(Event* opEv)
Description
This method is called by the timer manager when the the delay of an event ends
Parameters
Event* opEv : the event whose the delay ends
void threadMain()
Description
This is the main function of the thread. It get the first event of the event queue and dispatch it to the good state machine
void scheduleTimeout(Event* opEv)
Description
Call the timer manager to schedule a timeout for the delay of an event
Parameters
Event* opEv : a pointer to the event that needs a delay
void dispatchEvent(Event* opEv) [virtual]
Description
The event to the good state machine to process it
Parameters
Event* opEv : the event to dispatch
void deleteEvent(Event* opEv)
Description
Delete the given event
Parameters
Event* opEv : the event to delete