GM6000 Digital Heater Controller Build: 16 (Branch = develop)
SDX-1330
Array.h
Go to the documentation of this file.
1#ifndef Cpl_Dm_Mp_Array_h_
2#define Cpl_Dm_Mp_Array_h_
3/*-----------------------------------------------------------------------------
4 * This file is part of the Colony.Core Project. The Colony.Core Project is an
5 * open source project with a BSD type of licensing agreement. See the license
6 * agreement (license.txt) in the top/ directory or on the Internet at
7 * http://integerfox.com/colony.core/license.txt
8 *
9 * Copyright (c) 2014-2025 John T. Taylor
10 *
11 * Redistributions of the source code must retain the above copyright notice.
12 *----------------------------------------------------------------------------*/
13/** @file */
14
15
17
18
19/** The number of Elements in the temporary array (that is allocated on the
20 STACK) when parsing the array elements in the fromJSON_() method.
21 */
22#ifndef OPTION_CPL_DM_MP_ARRAY_TEMP_ARRAY_NUM_ELEMENTS
23#define OPTION_CPL_DM_MP_ARRAY_TEMP_ARRAY_NUM_ELEMENTS 8
24#endif
25
26
27///
28namespace Cpl {
29///
30namespace Dm {
31///
32namespace Mp {
33
34
35/** This a mostly concrete class provides 'common' implementation for a Model
36 Point who's data is a array of elements
37
38 The toJSON()/fromJSON format is:
39 \code
40
41 { name:"<mpname>", type:"<mptypestring>", valid:true|false seqnum:nnnn, locked:true|false, val:{start:<firstIndex>,elems:[<elemN>,<elemN+1>,...]}}" }
42
43 \endcode
44
45 */
47{
48protected:
49 /// Meta data for read/write/copy operations
50 struct MetaData_T
51 {
52 uint8_t* elemPtr; //!< Pointer to the 1st element in the array to read/write
53 size_t numElements; //!< Number of element to read/write
54 size_t elemIndex; //!< Starting array index
55 };
56
57protected:
58 /// Number of elements in the array
59 size_t m_numElements;
60
61 /// Size, in bytes, of an element
62 size_t m_elementSize;
63
64protected:
65 /// Constructor: Invalid MP
67 const char* symbolicName,
68 void* myDataPtr,
69 size_t numElements,
70 size_t elementSize );
71
72
73 /** Constructor. Valid MP. Requires an initial value. If the 'initialValueSrcPtr'
74 pointer is set to zero, then the entire array will be initialized to
75 zero. Note: The array that 'initialValueSrcPtr' points to ' MUST contain
76 at least 'numElements' elements.
77 */
79 const char* symbolicName,
80 void* myDataPtr,
81 size_t numElements,
82 size_t elementSize,
83 void* initialValueSrcPtr );
84
85protected:
86 /** The caller can read a subset of array starting from the specified index
87 in the Model Point's array. Note: if srcIndex + dstNumElements exceeds
88 the size of the MP's data then the read operation will be truncated.
89 */
90 virtual bool readArrayElements( void* dstData, size_t dstNumElements, size_t srcIndex = 0, uint16_t* seqNumPtr = 0 ) const noexcept;
91
92 /** The caller can write a subset of array starting from the specified index
93 in the Model Point's array. Note: if dstIndex + srcNumElements exceeds
94 the size of the MP's data then the write operation will be truncated
95
96 NOTE: The application/caller is responsible for what a 'partial write'
97 means to the integrity of the MP's data. WARNING: Think before
98 doing a partial write! For example, if the MP is in the invalid
99 state and a partial write is done - then the MP's data/array is
100 only partially initialized AND then MP is now in the valid
101 state!
102 */
103 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;
104
105 /// Updates the MP with the valid-state/data from 'src'. Note: the src.lock state is NOT copied
106 virtual uint16_t copyArrayFrom( const ArrayBase_& src, Cpl::Dm::ModelPoint::LockRequest_T lockRequest = Cpl::Dm::ModelPoint::eNO_REQUEST ) noexcept;
107
108public:
109 /// Returns the number of element in the array. This method IS thread safe.
110 inline size_t getNumElements() const noexcept
111 {
112 return m_numElements;
113 }
114
115public:
116 /// See Cpl::Dm::ModelPoint
117 void copyDataTo_( void* dstData, size_t dstSize ) const noexcept;
118
119 /// See Cpl::Dm::ModelPoint
120 void copyDataFrom_( const void* srcData, size_t srcSize ) noexcept;
121
122 /// See Cpl::Dm::ModelPoint.
123 bool isDataEqual_( const void* otherData ) const noexcept;
124
125
126 /// See Cpl::Dm::Point.
127 size_t getInternalDataSize_() const noexcept;
128
129 /// See Cpl::Dm::ModelPoint.
130 bool importMetadata_( const void* srcDataStream, size_t& bytesConsumed ) noexcept;
131
132 /// See Cpl::Dm::ModelPoint.
133 bool exportMetadata_( void* dstDataStream, size_t& bytesAdded ) const noexcept;
134};
135
136/** This template class extends the implementation of ArrayBase_ to support
137 the toJSON() and fromJSON_() methods for numeric element types.
138
139 NOTES:
140 1) All methods in this class are NOT thread Safe unless explicitly
141 documented otherwise.
142*/
143template <class ELEMTYPE>
144class NumericArrayBase_ : public ArrayBase_
145{
146protected:
147 /// Constructor: Invalid MP
149 const char* symbolicName,
150 ELEMTYPE* myDataPtr,
151 size_t numElements )
152 : ArrayBase_( myModelBase, symbolicName, myDataPtr, numElements, sizeof( ELEMTYPE ) )
153 {
154 }
155
156
157 /** Constructor. Valid MP. Requires an initial value. If the 'srcData'
158 pointer is set to zero, then the entire array will be initialized to
159 zero. Note: 'srcData' MUST contain at least 'numElements' elements.
160 */
162 const char* symbolicName,
163 ELEMTYPE* myDataPtr,
164 size_t numElements,
165 ELEMTYPE* srcData )
166 : ArrayBase_( myModelBase, symbolicName, myDataPtr, numElements, sizeof( ELEMTYPE ), srcData )
167 {
168 }
169
170
171public:
172 /// Type safe read. See Cpl::Dm::ModelPoint
173 inline bool read( ELEMTYPE* dstArrray, size_t dstNumElements, size_t srcIndex = 0, uint16_t* seqNumPtr = 0 ) const noexcept
174 {
175 return ArrayBase_::readArrayElements( dstArrray, dstNumElements, srcIndex, seqNumPtr );
176 }
177
178 /// Type safe write. See Cpl::Dm::ModelPoint
179 inline 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
180 {
181 return ArrayBase_::writeArrayElements( srcArray, srcNumElements, dstIndex, lockRequest );
182 }
183
184public:
185 /** This method is used to read the MP contents and synchronize
186 the observer with the current MP contents. This method should ONLY be
187 used in the notification callback method and the 'observerToSync'
188 argument MUST be the argument provided by the callback method
189
190 Note: The observer will be subscribed for change notifications after
191 this call.
192 */
193 inline bool readAndSync( ELEMTYPE* dstArrray,
194 size_t dstNumElements,
195 SubscriberApi& observerToSync,
196 size_t srcIndex = 0 )
197 {
198 uint16_t seqNum;
199 return readAndSync( dstArrray, dstNumElements, observerToSync, seqNum , srcIndex);
200 }
201
202 /** Same as readAndSync() above, but in addition returns the
203 sequence number of the MP.
204 */
205 inline bool readAndSync( ELEMTYPE* dstArrray,
206 size_t dstNumElements,
207 SubscriberApi& observerToSync,
208 uint16_t& seqNum,
209 size_t srcIndex = 0 )
210 {
211 bool result = ArrayBase_::readArrayElements( dstArrray, dstNumElements, srcIndex, &seqNum );
212 ArrayBase_::attachSubscriber( observerToSync, seqNum );
213 return result;
214 }
215
216protected:
217 /// See Cpl::Dm::Point.
218 void setJSONVal( JsonDocument& doc ) noexcept
219 {
220 JsonObject obj = doc.createNestedObject( "val" );
221 obj["start"] = 0;
222 JsonArray arr = obj.createNestedArray( "elems" );
223 ELEMTYPE* elemPtr = (ELEMTYPE*)m_dataPtr;
224 for ( size_t i = 0; i < m_numElements; i++ )
225 {
226 arr.add( elemPtr[i] );
227 }
228 }
229
230public:
231 /// See Cpl::Dm::Point.
232 bool fromJSON_( JsonVariant& src, Cpl::Dm::ModelPoint::LockRequest_T lockRequest, uint16_t& retSequenceNumber, Cpl::Text::String* errorMsg ) noexcept
233 {
234 // Check for object
235 if ( src.is<JsonObject>() == false )
236 {
237 if ( errorMsg )
238 {
239 *errorMsg = "'val' key/value pair is NOT an JSON object";
240 }
241 return false;
242 }
243
244 // Check for embedded array
245 JsonArray elems = src["elems"];
246 if ( elems.isNull() )
247 {
248 if ( errorMsg )
249 {
250 *errorMsg = "'val' key/value pair is missing the embedded 'elems' array";
251 }
252 return false;
253 }
254
255 // Get starting index (note: if not present a default of '0' will be returned)
256 size_t startIdx = src["start"] | 0;
257
258 // Check for exceeding array limits
259 size_t numElements = elems.size();
260 if ( numElements + startIdx > m_numElements )
261 {
262 if ( errorMsg )
263 {
264 errorMsg->format( "Number of array elements ([%lu+%lu)] exceeds the MP's element count (%lu)", startIdx, numElements, m_numElements );
265 }
266 return false;
267 }
268
269 // Update the Model Point in 'M' elements at a time (helps to reduce 'noise' on the MP's sequence number)
270 size_t offset = 0;
271 while ( numElements )
272 {
273 // Attempt to parse the value key/value pair (as a simple numeric)
275 size_t idx;
276 for ( idx = 0; idx < numElements && idx < OPTION_CPL_DM_MP_ARRAY_TEMP_ARRAY_NUM_ELEMENTS; idx++ )
277 {
278 // Is the element syntacticly correct?
279 if ( elems[idx].is<ELEMTYPE>() == false )
280 {
281 if ( errorMsg )
282 {
283 errorMsg->format( "Failed parsing element[%lu]. Content of the MP is suspect!", offset );
284 }
285 return false;
286 }
287 tempArray[idx] = elems[idx + offset].as<ELEMTYPE>();
288 }
289 retSequenceNumber = ArrayBase_::writeArrayElements( tempArray, idx, startIdx + offset, lockRequest );
290 offset += idx;
291 numElements -= idx;
292 }
293
294 return true;
295 }
296};
297
298/** This mostly concrete template class implements an 'numeric Array' Model Point
299 with an element size of N. A child class is still required. The child classes
300 must provide the following:
301
302 getTypeAsText() method and a typedef for child specific 'Observer'
303*/
304template <class ELEMTYPE, int NUMELEMS, class MPTYPE>
305class NumericArray_ : public NumericArrayBase_<ELEMTYPE>
306{
307protected:
308 /// The data store the MP
309 ELEMTYPE m_data[NUMELEMS];
310
311protected:
312 /// Constructor: Invalid MP
314 const char* symbolicName )
315 : NumericArrayBase_<ELEMTYPE>( myModelBase, symbolicName, m_data, NUMELEMS )
316 {
317 }
318
319
320 /** Constructor. Valid MP. Requires an initial value. If the 'srcData'
321 pointer is set to zero, then the entire array will be initialized to
322 zero. Note: 'srcData' MUST contain at least 'numElements' elements.
323 */
325 const char* symbolicName,
326 ELEMTYPE* srcData )
327 : NumericArrayBase_<ELEMTYPE>( myModelBase, symbolicName, m_data, NUMELEMS, srcData )
328 {
329 }
330
331public:
332 /// Updates the MP's data/valid-state from 'src'.
333 inline uint16_t copyFrom( const MPTYPE& src, Cpl::Dm::ModelPoint::LockRequest_T lockRequest = Cpl::Dm::ModelPoint::eNO_REQUEST ) noexcept
334 {
335 return ArrayBase_::copyArrayFrom( src, lockRequest );
336 }
337
338 /// Type safe register observer
339 inline void attach( Cpl::Dm::Subscriber<MPTYPE>& observer, uint16_t initialSeqNumber = Cpl::Dm::ModelPoint::SEQUENCE_NUMBER_UNKNOWN ) noexcept
340 {
341 ArrayBase_::attachSubscriber( observer, initialSeqNumber );
342 }
343
344 /// Type safe un-register observer
345 inline void detach( Cpl::Dm::Subscriber<MPTYPE>& observer ) noexcept
346 {
347 ArrayBase_::detachSubscriber( observer );
348 }
349};
350
351//////////////////////////////////////////////////////////////////////////////
352/* The following classes provide concrete numeric Array types for basic types
353 */
354
355/// uint8_t Array
356template <int N>
357class ArrayUint8 : public NumericArray_<uint8_t, N, ArrayUint8<N>>
358{
359public:
360 /// Constructor. Invalid Point
361 ArrayUint8( Cpl::Dm::ModelDatabase& myModelBase, const char* symbolicName )
362 : Mp::NumericArray_<uint8_t, N, ArrayUint8<N>>( myModelBase, symbolicName )
363 {
364 }
365
366 /// Constructor. Valid Point. Requires an initial value. The array size of 'initialValueArray' must match 'N'
367 ArrayUint8( Cpl::Dm::ModelDatabase& myModelBase, const char* symbolicName, uint8_t initialValueArray[] )
368 : Mp::NumericArray_<uint8_t, N, ArrayUint8<N>>( myModelBase, symbolicName, initialValueArray )
369 {
370 }
371
372 /// See Cpl::Dm::ModelPoint.
373 const char* getTypeAsText() const noexcept
374 {
375 return "Cpl::Dm::Mp::ArrayUint8";
376 }
377
378 /// Type safe subscriber
380};
381
382/// uint32_t Array
383template <int N>
384class ArrayUint32 : public NumericArray_<uint32_t, N, ArrayUint32<N>>
385{
386public:
387 /// Constructor. Invalid Point
388 ArrayUint32( Cpl::Dm::ModelDatabase& myModelBase, const char* symbolicName )
389 : Mp::NumericArray_<uint32_t, N, ArrayUint32<N>>( myModelBase, symbolicName )
390 {
391 }
392
393 /// Constructor. Valid Point. Requires an initial value. The array size of 'initialValueArray' must match 'N'
394 ArrayUint32( Cpl::Dm::ModelDatabase& myModelBase, const char* symbolicName, uint32_t initialValueArray[] )
395 : Mp::NumericArray_<uint32_t, N, ArrayUint32<N>>( myModelBase, symbolicName, initialValueArray )
396 {
397 }
398
399 /// See Cpl::Dm::ModelPoint.
400 const char* getTypeAsText() const noexcept
401 {
402 return "Cpl::Dm::Mp::ArrayUint32";
403 }
404
405 /// Type safe subscriber
407};
408
409/// uint64_t Array
410template <int N>
411class ArrayUint64 : public NumericArray_<uint64_t, N, ArrayUint64<N>>
412{
413public:
414 /// Constructor. Invalid Point
415 ArrayUint64( Cpl::Dm::ModelDatabase& myModelBase, const char* symbolicName )
416 : Mp::NumericArray_<uint64_t, N, ArrayUint64<N>>( myModelBase, symbolicName )
417 {
418 }
419
420 /// Constructor. Valid Point. Requires an initial value. The array size of 'initialValueArray' must match 'N'
421 ArrayUint64( Cpl::Dm::ModelDatabase& myModelBase, const char* symbolicName, uint64_t initialValueArray[] )
422 : Mp::NumericArray_<uint64_t, N, ArrayUint64<N>>( myModelBase, symbolicName, initialValueArray )
423 {
424 }
425
426 /// See Cpl::Dm::ModelPoint.
427 const char* getTypeAsText() const noexcept
428 {
429 return "Cpl::Dm::Mp::ArrayUint64";
430 }
431
432 /// Type safe subscriber
434};
435
436/// int8_t Array
437template <int N>
438class ArrayInt8 : public NumericArray_<int8_t, N, ArrayInt8<N>>
439{
440public:
441 /// Constructor. Invalid Point
442 ArrayInt8( Cpl::Dm::ModelDatabase& myModelBase, const char* symbolicName )
443 : Mp::NumericArray_<int8_t, N, ArrayInt8<N>>( myModelBase, symbolicName )
444 {
445 }
446
447 /// Constructor. Valid Point. Requires an initial value. The array size of 'initialValueArray' must match 'N'
448 ArrayInt8( Cpl::Dm::ModelDatabase& myModelBase, const char* symbolicName, int8_t initialValueArray[] )
449 : Mp::NumericArray_<int8_t, N, ArrayInt8<N>>( myModelBase, symbolicName, initialValueArray )
450 {
451 }
452
453 /// See Cpl::Dm::ModelPoint.
454 const char* getTypeAsText() const noexcept
455 {
456 return "Cpl::Dm::Mp::ArrayInt8";
457 }
458
459 /// Type safe subscriber
461};
462
463/// int32_t Array
464template <int N>
465class ArrayInt32 : public NumericArray_<int32_t, N, ArrayInt32<N>>
466{
467public:
468 /// Constructor. Invalid Point
469 ArrayInt32( Cpl::Dm::ModelDatabase& myModelBase, const char* symbolicName )
470 : Mp::NumericArray_<int32_t, N, ArrayInt32<N>>( myModelBase, symbolicName )
471 {
472 }
473
474 /// Constructor. Valid Point. Requires an initial value. The array size of 'initialValueArray' must match 'N'
475 ArrayInt32( Cpl::Dm::ModelDatabase& myModelBase, const char* symbolicName, int32_t initialValueArray[] )
476 : Mp::NumericArray_<int32_t, N, ArrayInt32<N>>( myModelBase, symbolicName, initialValueArray )
477 {
478 }
479
480 /// See Cpl::Dm::ModelPoint.
481 const char* getTypeAsText() const noexcept
482 {
483 return "Cpl::Dm::Mp::ArrayInt32";
484 }
485
486 /// Type safe subscriber
488};
489
490/// int64_t Array
491template <int N>
492class ArrayInt64 : public NumericArray_<int64_t, N, ArrayInt64<N>>
493{
494public:
495 /// Constructor. Invalid Point
496 ArrayInt64( Cpl::Dm::ModelDatabase& myModelBase, const char* symbolicName )
497 : Mp::NumericArray_<int64_t, N, ArrayInt64<N>>( myModelBase, symbolicName )
498 {
499 }
500
501 /// Constructor. Valid Point. Requires an initial value. The array size of 'initialValueArray' must match 'N'
502 ArrayInt64( Cpl::Dm::ModelDatabase& myModelBase, const char* symbolicName, int64_t initialValueArray[] )
503 : Mp::NumericArray_<int64_t, N, ArrayInt64<N>>( myModelBase, symbolicName, initialValueArray )
504 {
505 }
506
507 /// See Cpl::Dm::ModelPoint.
508 const char* getTypeAsText() const noexcept
509 {
510 return "Cpl::Dm::Mp::ArrayInt64";
511 }
512
513 /// Type safe subscriber
515};
516
517/// float Array
518template <int N>
519class ArrayFloat : public NumericArray_<float, N, ArrayFloat<N>>
520{
521public:
522 /// Constructor. Invalid Point
523 ArrayFloat( Cpl::Dm::ModelDatabase& myModelBase, const char* symbolicName )
524 : Mp::NumericArray_<float, N, ArrayFloat<N>>( myModelBase, symbolicName )
525 {
526 }
527
528 /// Constructor. Valid Point. Requires an initial value. The array size of 'initialValueArray' must match 'N'
529 ArrayFloat( Cpl::Dm::ModelDatabase& myModelBase, const char* symbolicName, float initialValueArray[] )
530 : Mp::NumericArray_<float, N, ArrayFloat<N>>( myModelBase, symbolicName, initialValueArray )
531 {
532 }
533
534 /// See Cpl::Dm::ModelPofloat.
535 const char* getTypeAsText() const noexcept
536 {
537 return "Cpl::Dm::Mp::ArrayFloat";
538 }
539
540 /// Type safe subscriber
542};
543
544/// double Array
545template <int N>
546class ArrayDouble : public NumericArray_<double, N, ArrayDouble<N>>
547{
548public:
549 /// Constructor. Invalid Point
550 ArrayDouble( Cpl::Dm::ModelDatabase& myModelBase, const char* symbolicName )
551 : Mp::NumericArray_<double, N, ArrayDouble<N>>( myModelBase, symbolicName )
552 {
553 }
554
555 /// Constructor. Valid Point. Requires an initial value. The array size of 'initialValueArray' must match 'N'
556 ArrayDouble( Cpl::Dm::ModelDatabase& myModelBase, const char* symbolicName, double initialValueArray[] )
557 : Mp::NumericArray_<double, N, ArrayDouble<N>>( myModelBase, symbolicName, initialValueArray )
558 {
559 }
560
561 /// See Cpl::Dm::ModelPodouble.
562 const char* getTypeAsText() const noexcept
563 {
564 return "Cpl::Dm::Mp::ArrayDouble";
565 }
566
567 /// Type safe subscriber
569};
570
571}; // end namespaces
572};
573};
574#endif // end header latch
#define OPTION_CPL_DM_MP_ARRAY_TEMP_ARRAY_NUM_ELEMENTS
The number of Elements in the temporary array (that is allocated on the STACK) when parsing the array...
Definition Array.h:23
This concrete class implements a simple Model Database.
Definition ModelDatabase.h:56
This concrete class provide common infrastructure for a Model Point.
Definition ModelPointCommon_.h:32
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...
Definition ModelPointCommon_.h:93
void * m_dataPtr
Reference to my Data.
Definition ModelPointCommon_.h:226
This mostly abstract class defines the interface for a Model Point.
Definition ModelPoint.h:46
LockRequest_T
Options related to the Model Point's locked state.
Definition ModelPoint.h:50
@ eNO_REQUEST
No change in the MP's lock state is requested.
Definition ModelPoint.h:51
static const uint16_t SEQUENCE_NUMBER_UNKNOWN
Magic value to use when registering for a change notification and application does not 'know' the cur...
Definition ModelPoint.h:62
virtual void setJSONVal(JsonDocument &doc) noexcept=0
This method converts the MP data to a JSON key/value pair.
virtual void attachSubscriber(SubscriberApi &observer, uint16_t initialSeqNumber=SEQUENCE_NUMBER_UNKNOWN) noexcept=0
This method is used to attach a subscriber to a Model Point.
virtual bool fromJSON_(JsonVariant &src, LockRequest_T lockRequest, uint16_t &retSequenceNumber, Cpl::Text::String *errorMsg) noexcept=0
This method has PACKAGE Scope, i.e.
This a mostly concrete class provides 'common' implementation for a Model Point who's data is a array...
Definition Array.h:46
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.
size_t elemIndex
Starting array index.
Definition Array.h:53
uint8_t * elemPtr
Pointer to the 1st element in the array to read/write.
Definition Array.h:51
size_t getNumElements() const noexcept
Returns the number of element in the array. This method IS thread safe.
Definition Array.h:109
void copyDataTo_(void *dstData, size_t dstSize) const noexcept
See Cpl::Dm::ModelPoint.
size_t m_numElements
Number of elements in the array.
Definition Array.h:58
bool exportMetadata_(void *dstDataStream, size_t &bytesAdded) 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 isDataEqual_(const void *otherData) const noexcept
See Cpl::Dm::ModelPoint.
size_t numElements
Number of element to read/write.
Definition Array.h:52
void copyDataFrom_(const void *srcData, size_t srcSize) noexcept
See Cpl::Dm::ModelPoint.
size_t m_elementSize
Size, in bytes, of an element.
Definition Array.h:61
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.
ArrayBase_(Cpl::Dm::ModelDatabase &myModelBase, const char *symbolicName, void *myDataPtr, size_t numElements, size_t elementSize)
Constructor: Invalid MP.
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.
Meta data for read/write/copy operations.
Definition Array.h:50
double Array
Definition Array.h:546
float Array
Definition Array.h:519
int32_t Array
Definition Array.h:465
int64_t Array
Definition Array.h:492
int8_t Array
Definition Array.h:438
uint32_t Array
Definition Array.h:384
uint64_t Array
Definition Array.h:411
uint8_t Array
Definition Array.h:357
This mostly concrete template class implements an 'numeric Array' Model Point with an element size of...
Definition Array.h:305
This template class extends the implementation of ArrayBase_ to support the toJSON() and fromJSON_() ...
Definition Array.h:144
This abstract class defines the Subscriber interface - for change notifications - to a Model Points d...
Definition SubscriberApi.h:34
This template class defines a type safe Subscriber.
Definition Subscriber.h:82
This abstract class defines the operations that can be before on a NULL terminated string.
Definition String.h:40
The 'Cpl' namespace is the root name space for the Colony.
Definition Api16.h:20