KPN Things Device SDK
SenMLBase Class Referenceabstract

#include <senml_base.h>

Inheritance diagram for SenMLBase:
SenMLBasePack SenMLRecord SenMLPack SenMLSimplePack SenMLRecordTemplate< double > SenMLRecordTemplate< float > SenMLRecordTemplate< int > SenMLRecordTemplate< const char * > SenMLBinaryRecord SenMLBoolRecord SenMLRecordTemplate< T >

Public Member Functions

 SenMLBase ()
 
 ~SenMLBase ()
 
SenMLBasegetNext ()
 
SenMLBasegetRoot ()
 
virtual void adjustToBaseTime (double prev, double time)
 
virtual int fieldsToJson ()=0
 
virtual int fieldsToCbor ()=0
 

Protected Member Functions

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
 

Friends

class SenMLBasePack
 
class SenMLPack
 
class SenMLSimplePack
 
class SenMLRecord
 
class SenMLJsonListener
 
class SenMLBaseParser
 

Detailed Description

the base class for all objects that can be used in the senml data tree.

Constructor & Destructor Documentation

◆ SenMLBase()

SenMLBase::SenMLBase ( )

◆ ~SenMLBase()

SenMLBase::~SenMLBase ( )

Member Function Documentation

◆ adjustToBaseTime()

virtual void SenMLBase::adjustToBaseTime ( double  prev,
double  time 
)
inlinevirtual

Reimplemented in SenMLRecord.

◆ contentToCbor()

virtual int SenMLBase::contentToCbor ( )
protectedpure virtual

Implemented in SenMLRecord, and SenMLBasePack.

◆ contentToJson()

virtual int SenMLBase::contentToJson ( )
protectedpure virtual

Implemented in SenMLRecord, and SenMLBasePack.

◆ fieldsToCbor()

virtual int SenMLBase::fieldsToCbor ( )
pure virtual

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.

Implemented in SenMLBinaryRecord, SenMLBoolRecord, SenMLDoubleRecord, SenMLFloatRecord, SenMLHalfFloatRecord, SenMLIntRecord, SenMLRecord, SenMLStringRecord, SenMLDoublePack, SenMLIntPack, SenMLPack, SenMLSimplePack, and SenMLBasePack.

◆ fieldsToJson()

virtual int SenMLBase::fieldsToJson ( )
pure virtual

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

Implemented in SenMLBinaryRecord, SenMLBoolRecord, SenMLDoubleRecord, SenMLFloatRecord, SenMLHalfFloatRecord, SenMLIntRecord, SenMLRecord, SenMLStringRecord, SenMLDoublePack, SenMLIntPack, SenMLPack, SenMLSimplePack, and SenMLBasePack.

◆ getArrayLength()

virtual int SenMLBase::getArrayLength ( )
inlineprotectedvirtual

Reimplemented in SenMLBasePack.

◆ getFieldLength()

virtual int SenMLBase::getFieldLength ( )
protectedpure virtual

◆ getNext()

SenMLBase * SenMLBase::getNext ( )
inline

get the next item in the list.

Returns
: a pointer to the next SenMLBase object in the list or NULL when at the end of the list.

◆ getPrev()

SenMLBase * SenMLBase::getPrev ( )
protected

◆ getRoot()

SenMLBase * SenMLBase::getRoot ( )

Get the root object of this list. Usually, this is a SenMLPack object. The root object is defined as the first item in the list.

Returns
: a pointer to the first SenMLBase object in the list or NULL when there is none.

◆ isPack()

virtual bool SenMLBase::isPack ( )
inlineprotectedvirtual

Reimplemented in SenMLBasePack.

◆ setNext()

void SenMLBase::setNext ( SenMLBase value)
protected

◆ setPrev()

void SenMLBase::setPrev ( SenMLBase value)
protected

Friends And Related Function Documentation

◆ SenMLBasePack

friend class SenMLBasePack
friend

◆ SenMLBaseParser

friend class SenMLBaseParser
friend

◆ SenMLJsonListener

friend class SenMLJsonListener
friend

◆ SenMLPack

friend class SenMLPack
friend

◆ SenMLRecord

friend class SenMLRecord
friend

◆ SenMLSimplePack

friend class SenMLSimplePack
friend

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