![]() |
GM6000 Digital Heater Controller Build: 20 (Branch = develop)
SDX-1330
|
This template class is a composer pattern/class that manages the callback function for a Model Point's Subscribers/Observers change notification. More...
This template class is a composer pattern/class that manages the callback function for a Model Point's Subscribers/Observers change notification.
A Composer is a structural pattern that may be used to employ composition when implementing an interface rather than using multiple inheritance. This allows a single concrete object to receive the change notifications callbacks from many Model Points.
Template Arguments: CONTEXT - The class that implements the Callback function MP - The concrete Model Point type.
#include <SubscriberComposer.h>
Public Types | |
| typedef void(CONTEXT::* | NotificationFunc_T) (MP &modelPointThatChanged, SubscriberApi &clientObserver) |
| Define a callback method function for the Change Notification callback (See Cpl::Dm::Subscriber<MP>::modelPointChanged for additional details) | |
Public Member Functions | |
| SubscriberComposer (Cpl::Dm::EventLoop &myEventLoop, CONTEXT &context, NotificationFunc_T notifyCallback) | |
| Constructor. | |
| void | modelPointChanged (MP &modelPointThatChanged, SubscriberApi &clientObserver) noexcept |
| See Cpl::Dm::Subscriber<MP> | |
Public Member Functions inherited from Cpl::Dm::Subscriber< MP > | |
| Subscriber (Cpl::Dm::EventLoop &myEventLoop) | |
| Constructor. | |
Public Member Functions inherited from Cpl::Dm::SubscriberBase | |
| SubscriberBase (Cpl::Dm::EventLoop &myEventLoop) | |
| Constructor. | |
| NotificationApi_ * | getNotificationApi_ () const noexcept |
| See Cpl::Dm::SubscriberApi. | |
| void | setModelPoint_ (ModelPoint *modelPoint) noexcept |
| See Cpl::Dm::SubscriberApi. | |
| ModelPoint * | getModelPoint_ () noexcept |
| See Cpl::Dm::SubscriberApi. | |
| int | getState_ () const noexcept |
| See Cpl::Dm::SubscriberApi. | |
| void | setState_ (int newState) noexcept |
| See Cpl::Dm::SubscriberApi. | |
| uint16_t | getSequenceNumber_ () const noexcept |
| See Cpl::Dm::SubscriberApi. | |
| void | setSequenceNumber_ (uint16_t newSeqNumber) noexcept |
| See Cpl::Dm::SubscriberApi. | |
Public Member Functions inherited from Cpl::Dm::SubscriberApi | |
| virtual | ~SubscriberApi () |
| Virtual destructor. | |
Public Member Functions inherited from Cpl::Container::Item | |
| 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. | |
Protected Attributes | |
| CONTEXT & | m_context |
| Class the implement the callback. | |
| NotificationFunc_T | m_notificationCb |
| Method (in my Context) to call for the change notification. | |
Protected Attributes inherited from Cpl::Dm::SubscriberBase | |
| int | m_state |
| Internal state of the subscriber. Note: The state is actual managed by the Model Point. | |
| ModelPoint * | m_point |
| Pointer to the Model Point the instance is subscribed to. | |
| Cpl::Dm::EventLoop & | m_eventLoopHdl |
| Reference to subscriber's EventFlag/Mailbox server. | |
| uint16_t | m_seqNumber |
| Sequence number of the subscriber. | |
Additional Inherited Members | |
Static Public Member Functions inherited from Cpl::Container::Item | |
| 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. | |
Public Attributes inherited from Cpl::Container::ExtendedItem | |
| void * | m_prevPtr_ |
| The previous link field. | |
Public Attributes inherited from Cpl::Container::Item | |
| void * | m_nextPtr_ |
| The link field. | |
| void * | m_inListPtr_ |
| Debug field. | |
Protected Member Functions inherited from Cpl::Dm::Subscriber< MP > | |
| void | genericModelPointChanged_ (ModelPoint &modelPointThatChanged, SubscriberApi &clientObserver) noexcept |
| See Cpl::Dm::SubscriberApi. | |
Protected Member Functions inherited from Cpl::Container::ExtendedItem | |
| ExtendedItem () | |
| Constructor. | |
| ExtendedItem (const char *ignoreThisParameter_usedToCreateAUniqueConstructor) | |
| Constructor used ONLY with the child class MapItem: -->special constructor to allow a Map to be statically allocated. | |
Protected Member Functions inherited from Cpl::Container::Item | |
| Item () | |
| Constructor. | |
| Item (const char *) | |
| Constructor used ONLY with the child class MapItem: -->special constructor to allow a Map to be statically allocated. | |
| typedef void(CONTEXT::* Cpl::Dm::SubscriberComposer< CONTEXT, MP >::NotificationFunc_T) (MP &modelPointThatChanged, SubscriberApi &clientObserver) |
Define a callback method function for the Change Notification callback (See Cpl::Dm::Subscriber<MP>::modelPointChanged for additional details)
| Cpl::Dm::SubscriberComposer< CONTEXT, MP >::SubscriberComposer | ( | Cpl::Dm::EventLoop & | myEventLoop, |
| CONTEXT & | context, | ||
| NotificationFunc_T | notifyCallback ) |
Constructor.
|
virtualnoexcept |
See Cpl::Dm::Subscriber<MP>
Implements Cpl::Dm::Subscriber< MP >.
|
protected |
Class the implement the callback.
|
protected |
Method (in my Context) to call for the change notification.