Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of kpn_senml by
SenMLBase Class Reference
the base class for all objects that can be used in the senml data tree. More...
#include <senml_base.h>
Inherited by SenMLPack, and SenMLRecord.
Public Member Functions | |
| SenMLBase * | getNext () |
| get the next item in the list. | |
| SenMLBase * | getRoot () |
| Get the root object of this list. | |
| virtual void | fieldsToJson ()=0 |
| renders all the fields to json, without the starting and ending brackets. | |
| virtual int | fieldsToCbor ()=0 |
| renders all the fields to cbor format. | |
Friends | |
| class | SenMLPack |
| class | SenMLRecord |
| class | SenMLJsonListener |
| class | SenMLBaseParser |
Detailed Description
the base class for all objects that can be used in the senml data tree.
Definition at line 29 of file senml_base.h.
Member Function Documentation
| virtual int 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, SenMLDoublePack, SenMLFloatRecord, SenMLIntPack, SenMLIntRecord, SenMLPack, SenMLRecord, and SenMLStringRecord.
| virtual void 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, SenMLDoublePack, SenMLFloatRecord, SenMLIntPack, SenMLIntRecord, SenMLPack, SenMLRecord, and SenMLStringRecord.
| SenMLBase* getNext | ( | ) |
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.
Definition at line 42 of file senml_base.h.
| 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.
Definition at line 53 of file senml_base.cpp.
Generated on Tue Jul 12 2022 23:07:22 by
1.7.2
