Peter Ferland / Cayenne-MQTT-mbed-M1

Dependents:   5_Dragonfly_Cayenne_Sprint_IKS01A1

Fork of Cayenne-MQTT-mbed-MTSAS by Peter Ferland

Embed: (wiki syntax)

« Back to documentation index

DataArray< BUFFER_SIZE, MAX_VALUES > Class Template Reference

DataArray< BUFFER_SIZE, MAX_VALUES > Class Template Reference

Class for manipulating a data array of unit/value pairs. More...

#include <CayenneDataArray.h>

Public Member Functions

 DataArray ()
 Construct an empty array.
void clear ()
 Clear the array.
void add (const char *unit, const char *value, bool unitInFlash=false, bool valueInFlash=false)
 Add the specified unit/value pair to the array.
void add (const char *unit, const int value)
 Add the specified unit/value pair to the array.
void add (const char *unit, const unsigned int value)
 Add the specified unit/value pair to the array.
void add (const char *unit, const long value)
 Add the specified unit/value pair to the array.
void add (const char *unit, const unsigned long value)
 Add the specified unit/value pair to the array.
void add (const char *unit, const float value)
 Add the specified unit/value pair to the array.
void add (const char *unit, const double value)
 Add the specified unit/value pair to the array.
void add (const char *unit, const float value)
 Add the specified unit/value pair to the array.
void add (const char *unit, const double value)
 Add the specified unit/value pair to the array.
void add (const char *unit, const __FlashStringHelper *value)
 Add the specified unit/value pair to the array.
void add (const __FlashStringHelper *unit, const char *value)
 Add the specified unit/value pair to the array.
void add (const __FlashStringHelper *unit, const __FlashStringHelper *value)
 Add the specified unit/value pair to the array.
void add (const __FlashStringHelper *unit, const int value)
 Add the specified unit/value pair to the array.
void add (const __FlashStringHelper *unit, const unsigned int value)
 Add the specified unit/value pair to the array.
void add (const __FlashStringHelper *unit, const long value)
 Add the specified unit/value pair to the array.
void add (const __FlashStringHelper *unit, const unsigned long value)
 Add the specified unit/value pair to the array.
void add (const __FlashStringHelper *unit, const float value)
 Add the specified unit/value pair to the array.
void add (const __FlashStringHelper *unit, const double value)
 Add the specified unit/value pair to the array.
const CayenneValuePairgetArray () const
 Get the unit/value pair array.
size_t getCount () const
 Get the number of items in the unit/value pair array.

Detailed Description

template<int BUFFER_SIZE = CAYENNE_MAX_MESSAGE_SIZE, int MAX_VALUES = CAYENNE_MAX_MESSAGE_VALUES>
class CayenneMQTT::DataArray< BUFFER_SIZE, MAX_VALUES >

Class for manipulating a data array of unit/value pairs.

Parameters:
BUFFER_SIZEMaximum buffer size to use for data array, in bytes.
MAX_VALUESMaximum number of unit/value pairs in the array.

Definition at line 36 of file CayenneDataArray.h.


Constructor & Destructor Documentation

DataArray (  )

Construct an empty array.

Definition at line 42 of file CayenneDataArray.h.


Member Function Documentation

void add ( const char *  unit,
const char *  value,
bool  unitInFlash = false,
bool  valueInFlash = false 
)

Add the specified unit/value pair to the array.

Parameters:
[in]unitThe unit to add.
[in]valueThe value to add.
[in]unitInFlashIf true the unit string is in flash memory, otherwise false.
[in]valueInFlashIf true the value string is in flash memory, otherwise false.

Definition at line 65 of file CayenneDataArray.h.

void add ( const char *  unit,
const unsigned int  value 
)

Add the specified unit/value pair to the array.

Parameters:
[in]unitThe unit to add.
[in]valueThe value to add.

Definition at line 121 of file CayenneDataArray.h.

void add ( const char *  unit,
const double  value 
)

Add the specified unit/value pair to the array.

Parameters:
[in]unitThe unit to add.
[in]valueThe value to add.

Definition at line 178 of file CayenneDataArray.h.

void add ( const __FlashStringHelper *  unit,
const double  value 
)

Add the specified unit/value pair to the array.

Parameters:
[in]unitThe unit to add.
[in]valueThe value to add.

Definition at line 305 of file CayenneDataArray.h.

void add ( const __FlashStringHelper *  unit,
const float  value 
)

Add the specified unit/value pair to the array.

Parameters:
[in]unitThe unit to add.
[in]valueThe value to add.

Definition at line 290 of file CayenneDataArray.h.

void add ( const __FlashStringHelper *  unit,
const long  value 
)

Add the specified unit/value pair to the array.

Parameters:
[in]unitThe unit to add.
[in]valueThe value to add.

Definition at line 268 of file CayenneDataArray.h.

void add ( const __FlashStringHelper *  unit,
const unsigned long  value 
)

Add the specified unit/value pair to the array.

Parameters:
[in]unitThe unit to add.
[in]valueThe value to add.

Definition at line 279 of file CayenneDataArray.h.

void add ( const __FlashStringHelper *  unit,
const unsigned int  value 
)

Add the specified unit/value pair to the array.

Parameters:
[in]unitThe unit to add.
[in]valueThe value to add.

Definition at line 257 of file CayenneDataArray.h.

void add ( const __FlashStringHelper *  unit,
const int  value 
)

Add the specified unit/value pair to the array.

Parameters:
[in]unitThe unit to add.
[in]valueThe value to add.

Definition at line 246 of file CayenneDataArray.h.

void add ( const __FlashStringHelper *  unit,
const __FlashStringHelper *  value 
)

Add the specified unit/value pair to the array.

Parameters:
[in]unitThe unit to add.
[in]valueThe value to add.

Definition at line 235 of file CayenneDataArray.h.

void add ( const __FlashStringHelper *  unit,
const char *  value 
)

Add the specified unit/value pair to the array.

Parameters:
[in]unitThe unit to add.
[in]valueThe value to add.

Definition at line 225 of file CayenneDataArray.h.

void add ( const char *  unit,
const __FlashStringHelper *  value 
)

Add the specified unit/value pair to the array.

Parameters:
[in]unitThe unit to add.
[in]valueThe value to add.

Definition at line 215 of file CayenneDataArray.h.

void add ( const char *  unit,
const double  value 
)

Add the specified unit/value pair to the array.

Parameters:
[in]unitThe unit to add.
[in]valueThe value to add.

Definition at line 201 of file CayenneDataArray.h.

void add ( const char *  unit,
const float  value 
)

Add the specified unit/value pair to the array.

Parameters:
[in]unitThe unit to add.
[in]valueThe value to add.

Definition at line 190 of file CayenneDataArray.h.

void add ( const char *  unit,
const long  value 
)

Add the specified unit/value pair to the array.

Parameters:
[in]unitThe unit to add.
[in]valueThe value to add.

Definition at line 136 of file CayenneDataArray.h.

void add ( const char *  unit,
const float  value 
)

Add the specified unit/value pair to the array.

Parameters:
[in]unitThe unit to add.
[in]valueThe value to add.

Definition at line 167 of file CayenneDataArray.h.

void add ( const char *  unit,
const unsigned long  value 
)

Add the specified unit/value pair to the array.

Parameters:
[in]unitThe unit to add.
[in]valueThe value to add.

Definition at line 151 of file CayenneDataArray.h.

void add ( const char *  unit,
const int  value 
)

Add the specified unit/value pair to the array.

Parameters:
[in]unitThe unit to add.
[in]valueThe value to add.

Definition at line 106 of file CayenneDataArray.h.

void clear (  )

Clear the array.

Definition at line 49 of file CayenneDataArray.h.

const CayenneValuePair* getArray (  ) const

Get the unit/value pair array.

Returns:
Pointer to the array.

Definition at line 320 of file CayenneDataArray.h.

size_t getCount (  ) const

Get the number of items in the unit/value pair array.

Returns:
Count of items.

Definition at line 328 of file CayenneDataArray.h.