![]() |
GM6000 Digital Heater Controller Build: 20 (Branch = develop)
SDX-1330
|
This concrete class provide common infrastructure for a Model Point. More...
This concrete class provide common infrastructure for a Model Point.
#include <ModelPointCommon_.h>
Public Member Functions | |
| const char * | getName () const noexcept |
| See Cpl::Dm::ModelPoint. | |
| size_t | getSize () const noexcept |
| See Cpl::Dm::ModelPoint. This method IS thread safe. | |
| uint16_t | getSequenceNumber () const noexcept |
| See Cpl::Dm::ModelPoint. | |
| uint16_t | touch () noexcept |
| See Cpl::Dm::ModelPoint. | |
| uint16_t | setInvalid (LockRequest_T lockRequest=eNO_REQUEST) noexcept |
| See Cpl::Dm::ModelPoint. | |
| bool | isNotValid (uint16_t *seqNumPtr=0) const noexcept |
| See Cpl::Dm::ModelPoint. | |
| bool | isLocked () const noexcept |
| See Cpl::Dm::ModelPoint. | |
| uint16_t | setLockState (LockRequest_T lockRequest) noexcept |
| See Cpl::Dm::ModelPoint. | |
| size_t | getExternalSize (bool includeLockedState=false) const noexcept |
| See Cpl::Dm::ModelPoint. | |
| size_t | exportData (void *dstDataStream, size_t maxDstLength, uint16_t *retSequenceNumber=0, bool includeLockedState=false) const noexcept |
| See Cpl::Dm::ModelPoint. Note: The implementation does NOT account for Endianess, i.e. assumes the 'platform' is the same for export/import. | |
| size_t | importData (const void *srcDataStream, size_t srcLength, uint16_t *retSequenceNumber=0, bool includeLockedState=false) noexcept |
| See Cpl::Dm::ModelPoint. Note: The implementation does NOT account for Endianess, i.e. assumes the 'platform' is the same for export/import. | |
| void | genericAttach (SubscriberApi &observer, uint16_t initialSeqNumber=SEQUENCE_NUMBER_UNKNOWN) noexcept |
| See Cpl::Dm::ModelPoint. | |
| void | genericDetach (SubscriberApi &observer) noexcept |
| See Cpl::Dm::ModelPoint. | |
| bool | toJSON (char *dst, size_t dstSize, bool &truncated, bool verbose=true, bool pretty=false) noexcept |
| See Cpl::Dm::ModelPoint. | |
| bool | isNotValidAndSync (SubscriberApi &observerToSync) |
| This method is used to test the validate state of the MP and synchronize the observer with the current MP contents. | |
| void | processSubscriptionEvent_ (SubscriberApi &subscriber, Event_T event) noexcept |
| See Cpl::Dm::ModelPoint. | |
Public Member Functions inherited from Cpl::Dm::ModelPoint | |
| virtual const char * | getTypeAsText () const noexcept=0 |
| This method returns a string identifier for the Model Point's data type. | |
| uint16_t | removeLock () noexcept |
| Short hand for unconditionally removing the lock from the MP. | |
| uint16_t | applyLock () noexcept |
| Short hand for putting the MP into the locked state. | |
| virtual bool | exportMetadata_ (void *dstDataStream, size_t &bytesAdded) const noexcept |
| This method has PACKAGE Scope, i.e. | |
| virtual bool | importMetadata_ (const void *srcDataStream, size_t &bytesConsumed) noexcept |
| This method has PACKAGE Scope, i.e. | |
| virtual bool | fromJSON_ (JsonVariant &src, LockRequest_T lockRequest, uint16_t &retSequenceNumber, Cpl::Text::String *errorMsg) noexcept=0 |
| This method has PACKAGE Scope, i.e. | |
| virtual | ~ModelPoint () |
| Virtual destructor to make the compiler happy. | |
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 Member Functions | |
| ModelPointCommon_ (ModelDatabase &myModelBase, const char *symbolicName, void *myDataPtr, size_t dataSizeInBytes, bool isValid=false) | |
| Constructor. | |
| bool | readAndSync (void *dstData, size_t dstSize, uint16_t &seqNum, SubscriberApi &observerToSync) |
| This method is used to read the MP contents and synchronize the observer with the current MP contents. | |
| bool | readData (void *dstData, size_t dstSize, uint16_t *seqNumPtr=0) const noexcept |
| See Cpl::Dm::ModelPoint. | |
| uint16_t | writeData (const void *srcData, size_t srcSize, LockRequest_T lockRequest=eNO_REQUEST) noexcept |
| See Cpl::Dm::ModelPoint. | |
| virtual uint16_t | copyDataAndStateFrom (const ModelPointCommon_ &src, LockRequest_T lockRequest) noexcept |
| Updates the MP with the valid-state/data from 'src'. Note: the src.lock state is NOT copied. | |
| void | attachSubscriber (SubscriberApi &observer, uint16_t initialSeqNumber=SEQUENCE_NUMBER_UNKNOWN) noexcept |
| See Cpl::Dm::ModelPoint. | |
| void | detachSubscriber (SubscriberApi &observer) noexcept |
| See Cpl::Dm::ModelPoint. | |
| void | copyDataTo_ (void *dstData, size_t dstSize) const noexcept |
| See Cpl::Dm::ModelPoint. | |
| void | copyDataFrom_ (const void *srcData, size_t srcSize) noexcept |
| See Cpl::Dm::ModelPoint. | |
| bool | isDataEqual_ (const void *otherData) const noexcept |
| See Cpl::Dm::ModelPoint. Note: This implementation does NOT work if the any of the data content are floats/double data types. | |
| const void * | getImportExportDataPointer_ () const noexcept |
| See Cpl::Dm::ModelPoint. | |
| size_t | getInternalDataSize_ () const noexcept |
| See Cpl::Dm::ModelPoint. | |
| virtual void | processDataUpdated () noexcept |
| Internal helper method that completes the data update process as well as ensuring any change notifications get generated. | |
| virtual void | processChangeNotifications () noexcept |
| Internal helper method that handles generating change notifications when the Model Point's data/state has changed. | |
| virtual void | advanceSequenceNumber () noexcept |
| Internal helper method that advances/updates the Model Point's sequence number. | |
| virtual bool | testAndUpdateLock (LockRequest_T lockRequest) noexcept |
| Internal helper method that manages testing and updating the locked state. | |
| virtual void | transitionToNotifyPending (SubscriberApi &subscriber) noexcept |
| Helper FSM method. | |
| virtual void | transitionToSubscribed (SubscriberApi &subscriber) noexcept |
| Helper FSM method. | |
| virtual JsonDocument & | beginJSON (bool isValid, bool locked, uint16_t seqnum, bool verbose=true) noexcept |
| Helper method when converting MP to a JSON string. | |
| virtual void | endJSON (char *dst, size_t dstSize, bool &truncated, bool verbose=true, bool pretty=false) noexcept |
| Helper method when converting MP to a JSON string. | |
| virtual void | hookSetInvalid () noexcept |
| Helper method that a child a class can override to change behavior when an MP is set to the invalid state. | |
Protected Member Functions inherited from Cpl::Dm::ModelPoint | |
| virtual void | setJSONVal (JsonDocument &doc) noexcept=0 |
| This method converts the MP data to a JSON key/value pair. | |
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. | |
Protected Attributes | |
| Cpl::Container::DList< SubscriberApi > | m_subscribers |
| List of Active Subscribers. | |
| const char * | m_name |
| The model point's symbolic name. | |
| ModelDatabase & | m_modelDatabase |
| Reference to the containing Model Base. | |
| void * | m_dataPtr |
| Reference to my Data. | |
| size_t | m_dataSize |
| Size of my data. | |
| uint16_t | m_seqNum |
| Sequence number used for tracking changes in the Point data. | |
| bool | m_locked |
| Locked state. | |
| bool | m_valid |
| valid/invalid state | |
Additional Inherited Members | |
Public Types inherited from Cpl::Dm::ModelPoint | |
| enum | LockRequest_T { eNO_REQUEST , eLOCK , eUNLOCK } |
| Options related to the Model Point's locked state. More... | |
| enum | Event_T { eATTACH , eDETACH , eDATA_CHANGED , eNOTIFYING , eNOTIFY_COMPLETE } |
| Subscriber events. More... | |
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::Item | |
| void * | m_nextPtr_ |
| The link field. | |
| void * | m_inListPtr_ |
| Debug field. | |
Static Public Attributes inherited from Cpl::Dm::ModelPoint | |
| static const uint16_t | SEQUENCE_NUMBER_UNKNOWN |
| Magic value to use when registering for a change notification and application does not 'know' the current sequence number value of the Model Point. | |
|
protected |
Constructor.
|
protectedvirtualnoexcept |
Internal helper method that advances/updates the Model Point's sequence number.
This method is NOT thread safe.
|
protectedvirtualnoexcept |
See Cpl::Dm::ModelPoint.
Implements Cpl::Dm::ModelPoint.
|
protectedvirtualnoexcept |
Helper method when converting MP to a JSON string.
|
protectedvirtualnoexcept |
Updates the MP with the valid-state/data from 'src'. Note: the src.lock state is NOT copied.
|
protectedvirtualnoexcept |
See Cpl::Dm::ModelPoint.
Implements Cpl::Dm::ModelPoint.
|
protectedvirtualnoexcept |
See Cpl::Dm::ModelPoint.
Implements Cpl::Dm::ModelPoint.
|
protectedvirtualnoexcept |
See Cpl::Dm::ModelPoint.
Implements Cpl::Dm::ModelPoint.
|
protectedvirtualnoexcept |
Helper method when converting MP to a JSON string.
|
virtualnoexcept |
See Cpl::Dm::ModelPoint. Note: The implementation does NOT account for Endianess, i.e. assumes the 'platform' is the same for export/import.
Implements Cpl::Dm::ModelPoint.
|
virtualnoexcept |
See Cpl::Dm::ModelPoint.
Implements Cpl::Dm::ModelPoint.
|
virtualnoexcept |
See Cpl::Dm::ModelPoint.
Implements Cpl::Dm::ModelPoint.
|
virtualnoexcept |
See Cpl::Dm::ModelPoint.
Implements Cpl::Dm::ModelPoint.
|
protectedvirtualnoexcept |
See Cpl::Dm::ModelPoint.
Implements Cpl::Dm::ModelPoint.
|
protectedvirtualnoexcept |
See Cpl::Dm::ModelPoint.
Implements Cpl::Dm::ModelPoint.
|
virtualnoexcept |
See Cpl::Dm::ModelPoint.
Implements Cpl::Dm::ModelPoint.
|
virtualnoexcept |
See Cpl::Dm::ModelPoint.
Implements Cpl::Dm::ModelPoint.
|
virtualnoexcept |
See Cpl::Dm::ModelPoint. This method IS thread safe.
Implements Cpl::Dm::ModelPoint.
|
protectedvirtualnoexcept |
Helper method that a child a class can override to change behavior when an MP is set to the invalid state.
The default behavior is to zero out the data (i.e. perform a memset(m_dataPtr,0, m_dataSize) call on the data)
Reimplemented in Ajax::Dm::MpAlert.
|
virtualnoexcept |
See Cpl::Dm::ModelPoint. Note: The implementation does NOT account for Endianess, i.e. assumes the 'platform' is the same for export/import.
Implements Cpl::Dm::ModelPoint.
|
protectedvirtualnoexcept |
See Cpl::Dm::ModelPoint. Note: This implementation does NOT work if the any of the data content are floats/double data types.
Implements Cpl::Dm::ModelPoint.
Reimplemented in Cpl::Dm::Mp::StringBase_.
|
virtualnoexcept |
See Cpl::Dm::ModelPoint.
Implements Cpl::Dm::ModelPoint.
|
virtualnoexcept |
See Cpl::Dm::ModelPoint.
Implements Cpl::Dm::ModelPoint.
|
inline |
This method is used to test the validate state of the MP and synchronize the observer with the current MP contents.
This method should ONLY be used in the notification callback method and the 'observerToSync' argument MUST be the argument provided by the callback method
Note: The observer will be subscribed for change notifications after this call
|
protectedvirtualnoexcept |
Internal helper method that handles generating change notifications when the Model Point's data/state has changed.
This method is NOT thread safe.
|
protectedvirtualnoexcept |
Internal helper method that completes the data update process as well as ensuring any change notifications get generated.
Note: This method ALWAYS sets the MP's state to 'valid'
This method is NOT thread safe.
|
virtualnoexcept |
See Cpl::Dm::ModelPoint.
Implements Cpl::Dm::ModelPoint.
|
inlineprotected |
This method is used to read the MP contents and synchronize the observer with the current MP contents.
This method should ONLY be used in the notification callback method and the 'observerToSync' argument MUST be the argument provided by the callback method
Note: The observer will be subscribed for change notifications after this call.
|
protectedvirtualnoexcept |
See Cpl::Dm::ModelPoint.
Implements Cpl::Dm::ModelPoint.
|
virtualnoexcept |
See Cpl::Dm::ModelPoint.
Implements Cpl::Dm::ModelPoint.
|
virtualnoexcept |
See Cpl::Dm::ModelPoint.
Implements Cpl::Dm::ModelPoint.
|
protectedvirtualnoexcept |
Internal helper method that manages testing and updating the locked state.
Rules: 1) If 'lockRequest' is eNO_REQUEST, the method only returns true if the MP is in the unlocked state 2) If 'lockRequest' is eLOCK, the method only returns if the MP is in the unlocked state. In addition, when true is returned the MP is put into the locked state. 3) If 'lockRequest' is eUNLOCK, the method always returns true and the MP is left in the unlocked state.
This method is NOT thread safe.
|
virtualnoexcept |
See Cpl::Dm::ModelPoint.
Implements Cpl::Dm::ModelPoint.
|
virtualnoexcept |
See Cpl::Dm::ModelPoint.
Implements Cpl::Dm::ModelPoint.
|
protectedvirtualnoexcept |
Helper FSM method.
|
protectedvirtualnoexcept |
Helper FSM method.
|
protectedvirtualnoexcept |
See Cpl::Dm::ModelPoint.
Implements Cpl::Dm::ModelPoint.
|
protected |
Reference to my Data.
|
protected |
Size of my data.
|
protected |
Locked state.
|
protected |
Reference to the containing Model Base.
|
protected |
The model point's symbolic name.
|
protected |
Sequence number used for tracking changes in the Point data.
|
protected |
List of Active Subscribers.
|
protected |
valid/invalid state