![]() |
GM6000 Digital Heater Controller Branch: main
SDX-1330
|
This concrete class provides an Event driven Runnable object for executing the read/write operation to persistent storage media for N Records. More...
This concrete class provides an Event driven Runnable object for executing the read/write operation to persistent storage media for N Records.
#include <RecordServer.h>
Public Member Functions | |
RecordServer (Record *recordList[], unsigned long timingTickInMsec=OPTION_CPL_SYSTEM_EVENT_LOOP_TIMEOUT_PERIOD, Cpl::System::SharedEventHandlerApi *eventHandler=0) noexcept | |
Constructor. | |
void | request (OpenMsg &msg) |
This method starts the server (See Cpl::Itc::OpenSync) | |
void | request (CloseMsg &msg) |
This method stops the server (See Cpl::Itc::CloseSync) | |
![]() | |
MailboxServer (unsigned long timingTickInMsec=OPTION_CPL_SYSTEM_EVENT_LOOP_TIMEOUT_PERIOD, Cpl::System::SharedEventHandlerApi *eventHandler=0) noexcept | |
Constructor. | |
void | appRun () |
See Cpl::System::Runnable. | |
![]() | |
EventLoop (unsigned long timingTickInMsec=OPTION_CPL_SYSTEM_EVENT_LOOP_TIMEOUT_PERIOD, Cpl::System::SharedEventHandlerApi *eventHandler=0) noexcept | |
Constructor. | |
void | addPendingChangingNotification_ (SubscriberApi &subscriber) noexcept |
This method has PACKAGE Scope, i.e. | |
void | removePendingChangingNotification_ (SubscriberApi &subscriber) noexcept |
This method has PACKAGE Scope, i.e. | |
![]() | |
EventLoop (unsigned long timeOutPeriodInMsec=OPTION_CPL_SYSTEM_EVENT_LOOP_TIMEOUT_PERIOD, SharedEventHandlerApi *eventHandler=0) | |
Constructor. | |
virtual | ~EventLoop () |
Virtual destructor. | |
int | signal (void) noexcept |
See Cpl::System::Signable. | |
int | su_signal (void) noexcept |
See Cpl::System::Signable. | |
void | pleaseStop () |
See Cpl::System::Runnable. | |
void | notifyEvents (Cpl_System_EventFlag_T events) noexcept |
See Cpl::System::EventFlag. | |
void | notify (uint8_t eventNumber) noexcept |
See Cpl::System::EventFlag. | |
void | su_notifyEvents (Cpl_System_EventFlag_T events) noexcept |
See Cpl::System::EventFlag. | |
void | su_notify (uint8_t eventNumber) noexcept |
See Cpl::System::EventFlag. | |
void | setThreadOfExecution_ (Thread *myThreadPtr) |
See Cpl::System::Runnable. | |
![]() | |
virtual | ~Runnable () |
Virtual destructor. | |
virtual void | run () |
This method is called when the Thread is started. | |
virtual bool | isRunning () noexcept |
This method returns true if the instance has 'entered' its run method; false is returned, i.e. | |
![]() | |
virtual | ~EventFlag () |
Virtual destructor. | |
![]() | |
virtual | ~Signable () |
Virtual destructor. | |
![]() | |
bool | insert_ (void *newContainerPtr) |
Helper method to trap when inserting an item in multiple containers. | |
bool | isInContainer_ (const void *containerPtr) const noexcept |
Returns 'true' if the instance is in the specified container. | |
![]() | |
TimerManager () | |
Constructor. | |
void | startManager (void) noexcept |
This method starts the Timer Manager. | |
void | processTimers (void) noexcept |
This method processes the current active timer lists. | |
bool | areActiveTimers (void) noexcept |
Returns true if there are NO active timers. | |
void | attach (CounterCallback_ &clientToCallback) noexcept |
See Cpl::System::CounterCallback_. | |
bool | detach (CounterCallback_ &clientToCallback) noexcept |
See Cpl::System::CounterCallback_. | |
unsigned long | msecToCounts (unsigned long milliseconds) noexcept |
See Cpl::System::CounterCallback_. | |
![]() | |
virtual | ~CounterSource_ () |
Virtual Destructor. | |
![]() | |
virtual | ~NotificationApi_ () |
Virtual destructor. | |
![]() | |
Mailbox (Cpl::System::Signable &myEventLoop) | |
Constructor. | |
void | post (Message &msg) noexcept |
See Cpl::Itc::PostApi. | |
void | postSync (Message &msg) noexcept |
See Cpl::Itc::PostApi. | |
![]() | |
virtual | ~PostApi () |
Virtual destructor. | |
![]() | |
SList () noexcept | |
Public constructor initializes head and tail pointers. | |
SList (const char *ignoreThisParameter_usedToCreateAUniqueConstructor) noexcept | |
This is a special constructor for when the list is statically declared (i.e. | |
void | move (SList< Message > &dst) noexcept |
Moves the content of the this queue to the specified queue. | |
void | clearTheList () noexcept |
Empties the list. | |
Message * | get (void) noexcept |
Removes the first item in the list. | |
void | put (Message &item) noexcept |
Adds the item as the last item in the list. | |
Message * | head (void) const noexcept |
Return a pointer to the first item in the list. | |
Message * | tail (void) const noexcept |
Return a pointer to the last item in the list. | |
Message * | pop (void) noexcept |
Removes the top element from stack and return a pointer to it as a result. | |
void | push (Message &item) noexcept |
Adds the ITEM item to top of the stack. | |
Message * | top (void) const noexcept |
Return a pointer to the top ITEM item in the stack. | |
Message * | getFirst (void) noexcept |
Removes the first item in the list. | |
Message * | getLast (void) noexcept |
Removes the last item in the list. | |
void | putFirst (Message &item) noexcept |
Adds the item as the first item in the list. | |
void | putLast (Message &item) noexcept |
Adds the item as the last item in the list. | |
bool | remove (Message &item) noexcept |
Remove specified ITEM element from the list. | |
void | insertAfter (Message &after, Message &item) noexcept |
Insert the "item" ITEM into the list behind the "after" ITEM element. | |
void | insertBefore (Message &before, Message &item) noexcept |
Insert the "item" ITEM into the list ahead of the "before" ITEM element. | |
bool | find (const Message &item) const noexcept |
Returns true if the specified item is already in the list, else false. | |
Message * | first (void) const noexcept |
Return a pointer to the first item in the list. | |
Message * | last (void) const noexcept |
Return a pointer to the last item in the list. | |
Message * | next (const Message &item) const noexcept |
Return a pointer to the item after the item "item". | |
![]() | |
CloseSync (PostApi &myMbox) noexcept | |
Constructor. | |
bool | close (void *args=nullptr) |
See CloseSync. | |
![]() | |
OpenSync (PostApi &myMbox) noexcept | |
Constructor. | |
bool | open (void *args=nullptr) |
See OpenApi. | |
![]() | |
virtual | ~OpenApi () |
Virtual destructor. | |
![]() | |
virtual | ~CloseApi () |
Virtual destructor. | |
Protected Attributes | |
Record ** | m_records |
Variable length list of Records to manage. | |
bool | m_opened |
Track my open state. | |
![]() | |
Cpl::Container::DList< SubscriberApi > | m_pendingMpNotifications |
List of pending Model Point Change Notifications. | |
![]() | |
Thread * | m_myThreadPtr |
A pointer to the thread the Event Loop executes in. | |
SharedEventHandlerApi * | m_eventHandler |
My shared event handler (if I have one) | |
Cpl::System::Semaphore | m_sema |
Semaphore associated with the mailbox (note: the Thread semaphore is NOT used) | |
unsigned long | m_timeout |
Timeout period for waiting on the next event. | |
unsigned long | m_timeStartOfLoop |
Timestamp, in milliseconds, of start of event/wait loop. | |
Cpl_System_EventFlag_T | m_events |
The variable holds the current state of all Event Flags. | |
bool | m_run |
Flag used to help with the pleaseStop() request. | |
![]() | |
bool | m_running |
Tracks the run state of the instance. | |
![]() | |
Cpl::Container::DList< CounterCallback_ > | m_counters |
List of active counters. | |
Cpl::Container::DList< CounterCallback_ > | m_pendingAttach |
List of Pending-to-attach counters (this happens when timers attach from the timer-expired-callbacks) | |
unsigned long | m_timeMark |
Elapsed time of the previous processing cycle. | |
unsigned long | m_timeNow |
Elapsed time of the current processing cycle. | |
bool | m_inTickCall |
Flag to tracks when I am actively processing/consuming ticks. | |
![]() | |
Cpl::System::Signable & | m_eventLoop |
The EventLoop that I wait-on/dispatch-msgs-from. | |
![]() | |
PostApi & | m_mbox |
Mailbox (of the server implementing the ITC request() method. | |
Additional Inherited Members | |
![]() | |
typedef Cpl::Itc::SAP< OpenRequest > | SAP |
SAP for this API. | |
typedef RequestMessage< OpenRequest, OpenPayload > | OpenMsg |
Message Type: Open. | |
![]() | |
typedef Cpl::Itc::SAP< CloseRequest > | SAP |
SAP for this API. | |
typedef RequestMessage< CloseRequest, ClosePayload > | CloseMsg |
Message Type: Close. | |
![]() | |
static void | remove_ (Item *itemPtr) noexcept |
Helper method to do the proper 'clean-up' for the multiple-containers-error-trap when removing an item from a container. | |
![]() | |
void * | m_nextPtr_ |
The link field. | |
void * | m_inListPtr_ |
Debug field. | |
![]() | |
bool | isPendingPendingChangingNotifications () noexcept |
This method returns true if there is at least one pending change notification. | |
virtual void | processChangeNotifications () noexcept |
This helper method processes pending change notifications. | |
![]() | |
virtual void | startEventLoop () noexcept |
This method is used to initialize the Event Loop's thread has started to executed. | |
virtual bool | waitAndProcessEvents (bool skipWait=false) noexcept |
This method is used to wait (and process) the next event(s). | |
virtual void | stopEventLoop () noexcept |
This method is used to clean-up the Event Loop's when the thread is being stopped. | |
virtual void | processEventFlag (uint8_t eventNumber) noexcept |
This method is used (by the concrete child class(es)) to process one or more Event Flags. | |
![]() | |
Runnable () | |
Constructor. | |
![]() | |
Item () | |
Constructor. | |
Item (const char *) | |
Constructor used ONLY with the child class MapItem: -->special constructor to allow a Map to be statically allocated. | |
![]() | |
void | addToActiveList (CounterCallback_ &clientToCallback) noexcept |
Helper method. | |
virtual void | tick (unsigned long milliseconds=1) noexcept |
This method is intended to be call by a the timing source and each call to this method represents that one tick has expired, i.e. | |
virtual void | tickComplete (void) noexcept |
This method is used by the Tick source to information the Timer Manager that there are no more ticks for the timing source's current tick cycle. | |
![]() | |
virtual void | processMessages () noexcept |
This operation is used process any pending messages. | |
bool | isPendingMessage () noexcept |
This method IS thread safe. | |
|
noexcept |
Constructor.
The argument 'timingTickInMsec' specifies the timing resolution that will be used for Cpl::Timer::Local Timers.
NOTE: 'recordList' is variable length array where the last entry in the array MUST BE a nullptr.
|
virtual |
This method stops the server (See Cpl::Itc::CloseSync)
Implements Cpl::Itc::CloseRequest.
|
virtual |
This method starts the server (See Cpl::Itc::OpenSync)
Implements Cpl::Itc::OpenRequest.
|
protected |
Track my open state.
|
protected |
Variable length list of Records to manage.
The last item list must be ZERO to indicate the end-of-the list