KPN Things Device SDK
SenMLSimplePack Class Reference

#include <senml_simplepack.h>

Inheritance diagram for SenMLSimplePack:
SenMLBasePack SenMLBase

Public Member Functions

 SenMLSimplePack ()
 
 ~SenMLSimplePack ()
 
int fieldsToJson ()
 
int fieldsToCbor ()
 
int getFieldLength ()
 
- Public Member Functions inherited from SenMLBasePack
 SenMLBasePack ()
 
 ~SenMLBasePack ()
 
int toJson (Stream &dest, SenMLStreamMethod format=SENML_RAW)
 
int toJson (char *dest, int length, SenMLStreamMethod format=SENML_RAW)
 
int toCbor (Stream &dest, SenMLStreamMethod format=SENML_RAW)
 
int toCbor (char *dest, int length, SenMLStreamMethod format=SENML_RAW)
 
void fromJson (Stream &source, SenMLStreamMethod format=SENML_RAW)
 
void fromJson (const char *source)
 
void fromCbor (Stream &source, SenMLStreamMethod format=SENML_RAW)
 
void fromCbor (char *source, int length, SenMLStreamMethod format)
 
bool add (SenMLBase &item)
 
bool clear ()
 
SenMLBasegetFirst ()
 
virtual int getCount ()
 
virtual int fieldsToJson ()=0
 
virtual int fieldsToCbor ()=0
 
virtual const char * getBaseName ()
 
virtual SenMLUnit getBaseUnit ()
 
- Public Member Functions inherited from SenMLBase
 SenMLBase ()
 
 ~SenMLBase ()
 
SenMLBasegetNext ()
 
SenMLBasegetRoot ()
 
virtual void adjustToBaseTime (double prev, double time)
 
virtual int fieldsToJson ()=0
 
virtual int fieldsToCbor ()=0
 

Additional Inherited Members

- Protected Member Functions inherited from SenMLBasePack
virtual bool isPack ()
 
virtual bool isActuator ()
 
void setLast (SenMLBase &value)
 
virtual int contentToCbor ()
 
virtual int contentToJson ()
 
virtual int getArrayLength ()
 
virtual int getFieldLength ()
 
virtual void setupStreamCtx (char *dest, int length, SenMLStreamMethod format)
 
virtual void setupStreamCtx (Stream *dest, SenMLStreamMethod format)
 
- Protected Member Functions inherited from SenMLBase
virtual int contentToJson ()=0
 
void setNext (SenMLBase *value)
 
void setPrev (SenMLBase *value)
 
SenMLBasegetPrev ()
 
virtual bool isPack ()
 
virtual int contentToCbor ()=0
 
virtual int getArrayLength ()
 
virtual int getFieldLength ()=0
 

Constructor & Destructor Documentation

◆ SenMLSimplePack()

SenMLSimplePack::SenMLSimplePack ( )
inline

◆ ~SenMLSimplePack()

SenMLSimplePack::~SenMLSimplePack ( )
inline

Member Function Documentation

◆ fieldsToCbor()

int SenMLSimplePack::fieldsToCbor ( )
inlinevirtual

renders all the fields to cbor format. renders all the fields of the object without the length info at the beginning note: this is public so that custom implementations for the record object can use other objects internally and render to json using this function (ex: coordinatesRecord using 3 floatRecrods for lat, lon & alt.

Returns
: The number of bytes that were written.

Implements SenMLBasePack.

◆ fieldsToJson()

int SenMLSimplePack::fieldsToJson ( )
inlinevirtual

renders all the fields to json, without the starting and ending brackets. Inheriters can extend this function if they want to add extra fields to the json output note: this is public so that custom implementations for the record object can use other objects internally and render to json using this function (ex: coordinatesRecord using 3 floatRecrods for lat, lon & alt.

Returns
: None

Implements SenMLBasePack.

◆ getFieldLength()

int SenMLSimplePack::getFieldLength ( )
inlinevirtual

Reimplemented from SenMLBasePack.


The documentation for this class was generated from the following file: