![]() |
GM6000 Digital Heater Controller Build: 20 (Branch = develop)
SDX-1330
|
uint32_t Array More...
uint32_t Array
#include <Array.h>
Public Types | |
| typedef Cpl::Dm::Subscriber< ArrayUint32 > | Observer |
| Type safe subscriber. | |
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... | |
Public Member Functions | |
| ArrayUint32 (Cpl::Dm::ModelDatabase &myModelBase, const char *symbolicName) | |
| Constructor. Invalid Point. | |
| ArrayUint32 (Cpl::Dm::ModelDatabase &myModelBase, const char *symbolicName, uint32_t initialValueArray[]) | |
| Constructor. Valid Point. Requires an initial value. The array size of 'initialValueArray' must match 'N'. | |
| const char * | getTypeAsText () const noexcept |
| See Cpl::Dm::ModelPoint. | |
Public Member Functions inherited from Cpl::Dm::Mp::NumericArray_< uint32_t, N, ArrayUint32< N > > | |
| uint16_t | copyFrom (const ArrayUint32< N > &src, Cpl::Dm::ModelPoint::LockRequest_T lockRequest=Cpl::Dm::ModelPoint::eNO_REQUEST) noexcept |
| Updates the MP's data/valid-state from 'src'. | |
| void | attach (Cpl::Dm::Subscriber< ArrayUint32< N > > &observer, uint16_t initialSeqNumber=Cpl::Dm::ModelPoint::SEQUENCE_NUMBER_UNKNOWN) noexcept |
| Type safe register observer. | |
| void | detach (Cpl::Dm::Subscriber< ArrayUint32< N > > &observer) noexcept |
| Type safe un-register observer. | |
Public Member Functions inherited from Cpl::Dm::Mp::NumericArrayBase_< ELEMTYPE > | |
| bool | read (ELEMTYPE *dstArrray, size_t dstNumElements, size_t srcIndex=0, uint16_t *seqNumPtr=0) const noexcept |
| Type safe read. See Cpl::Dm::ModelPoint. | |
| uint16_t | write (const ELEMTYPE *srcArray, size_t srcNumElements, size_t dstIndex=0, Cpl::Dm::ModelPoint::LockRequest_T lockRequest=Cpl::Dm::ModelPoint::eNO_REQUEST) noexcept |
| Type safe write. See Cpl::Dm::ModelPoint. | |
| bool | readAndSync (ELEMTYPE *dstArrray, size_t dstNumElements, SubscriberApi &observerToSync, size_t srcIndex=0) |
| This method is used to read the MP contents and synchronize the observer with the current MP contents. | |
| bool | readAndSync (ELEMTYPE *dstArrray, size_t dstNumElements, SubscriberApi &observerToSync, uint16_t &seqNum, size_t srcIndex=0) |
| Same as readAndSync() above, but in addition returns the sequence number of the MP. | |
| bool | fromJSON_ (JsonVariant &src, Cpl::Dm::ModelPoint::LockRequest_T lockRequest, uint16_t &retSequenceNumber, Cpl::Text::String *errorMsg) noexcept |
| See Cpl::Dm::Point. | |
Public Member Functions inherited from Cpl::Dm::Mp::ArrayBase_ | |
| size_t | getNumElements () const noexcept |
| Returns the number of element in the array. This method IS thread safe. | |
| 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. | |
| size_t | getInternalDataSize_ () const noexcept |
| See Cpl::Dm::Point. | |
| bool | importMetadata_ (const void *srcDataStream, size_t &bytesConsumed) noexcept |
| See Cpl::Dm::ModelPoint. | |
| bool | exportMetadata_ (void *dstDataStream, size_t &bytesAdded) const noexcept |
| See Cpl::Dm::ModelPoint. | |
Public Member Functions inherited from Cpl::Dm::ModelPointCommon_ | |
| 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 | |
| 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 | ~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. | |
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::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 Member Functions inherited from Cpl::Dm::Mp::NumericArray_< uint32_t, N, ArrayUint32< N > > | |
| NumericArray_ (Cpl::Dm::ModelDatabase &myModelBase, const char *symbolicName) | |
| Constructor: Invalid MP. | |
| NumericArray_ (Cpl::Dm::ModelDatabase &myModelBase, const char *symbolicName, uint32_t *srcData) | |
| Constructor. | |
Protected Member Functions inherited from Cpl::Dm::Mp::NumericArrayBase_< ELEMTYPE > | |
| NumericArrayBase_ (Cpl::Dm::ModelDatabase &myModelBase, const char *symbolicName, ELEMTYPE *myDataPtr, size_t numElements) | |
| Constructor: Invalid MP. | |
| NumericArrayBase_ (Cpl::Dm::ModelDatabase &myModelBase, const char *symbolicName, ELEMTYPE *myDataPtr, size_t numElements, ELEMTYPE *srcData) | |
| Constructor. | |
| void | setJSONVal (JsonDocument &doc) noexcept |
| See Cpl::Dm::Point. | |
Protected Member Functions inherited from Cpl::Dm::Mp::ArrayBase_ | |
| ArrayBase_ (Cpl::Dm::ModelDatabase &myModelBase, const char *symbolicName, void *myDataPtr, size_t numElements, size_t elementSize) | |
| Constructor: Invalid MP. | |
| ArrayBase_ (Cpl::Dm::ModelDatabase &myModelBase, const char *symbolicName, void *myDataPtr, size_t numElements, size_t elementSize, void *initialValueSrcPtr) | |
| Constructor. | |
| virtual bool | readArrayElements (void *dstData, size_t dstNumElements, size_t srcIndex=0, uint16_t *seqNumPtr=0) const noexcept |
| The caller can read a subset of array starting from the specified index in the Model Point's array. | |
| virtual uint16_t | writeArrayElements (const void *srcData, size_t srcNumElements, size_t dstIndex=0, Cpl::Dm::ModelPoint::LockRequest_T lockRequest=Cpl::Dm::ModelPoint::eNO_REQUEST) noexcept |
| The caller can write a subset of array starting from the specified index in the Model Point's array. | |
| virtual uint16_t | copyArrayFrom (const ArrayBase_ &src, Cpl::Dm::ModelPoint::LockRequest_T lockRequest=Cpl::Dm::ModelPoint::eNO_REQUEST) noexcept |
| Updates the MP with the valid-state/data from 'src'. Note: the src.lock state is NOT copied. | |
Protected Member Functions inherited from Cpl::Dm::ModelPointCommon_ | |
| 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::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 inherited from Cpl::Dm::Mp::NumericArray_< uint32_t, N, ArrayUint32< N > > | |
| uint32_t | m_data [NUMELEMS] |
| The data store the MP. | |
Protected Attributes inherited from Cpl::Dm::Mp::ArrayBase_ | |
| size_t | m_numElements |
| Number of elements in the array. | |
| size_t | m_elementSize |
| Size, in bytes, of an element. | |
Protected Attributes inherited from Cpl::Dm::ModelPointCommon_ | |
| 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 | |
| typedef Cpl::Dm::Subscriber<ArrayUint32> Cpl::Dm::Mp::ArrayUint32< N >::Observer |
Type safe subscriber.
|
inline |
Constructor. Invalid Point.
|
inline |
Constructor. Valid Point. Requires an initial value. The array size of 'initialValueArray' must match 'N'.
|
inlinevirtualnoexcept |
See Cpl::Dm::ModelPoint.
Implements Cpl::Dm::ModelPoint.