Arduino KVComm  master
Key-Value pair communication library for Arduino
Files | Classes | Macros | Functions
Key-Value data

Key-Value, dictionary-like datastructure. More...

Files

file  KV_Builder.hpp
 This file contains the KV_Builder class, a key-value pair, dictionary-like container that supports many different types of data (numbers, arrays, vectors, strings ...).
 
file  KV_Helpers.hpp
 Helpers for address manipulation used to layout dictionary entries in memory.
 
file  KV_Iterator.hpp
 Iterating over a dictionary generated by the KV_Builder, used for parsing and for checking if a key is already in the entry.
 
file  KV_Parser.hpp
 A parser for dictionaries generated by the KV_Builder.
 
file  KV_Types.hpp
 KV_Type type definitions for fundamental types (int::_t, uint::_t, float, double, bool, char). These definitions specify how variables of these types should be serialized and deserialized when writing and reading them from/to the buffer.
 

Classes

class  KV_Builder
 A class for serializing key-value/array data in a dictionary-like container that can be sent to another Arduino or to a computer. More...
 
class  Static_KV_Builder< N >
 KV_Builder with a static buffer. More...
 
class  KV_Exception
 Custom exception for KVComm. Not used on Arduino. More...
 
class  KV_Iterator
 Class for iterating over a dictionary generated by the KV_Builder, used for parsing and for checking if a key is already in the entry. More...
 
class  KV_Parser
 A parser for dictionaries generated by the KV_Builder. More...
 
struct  KV_Type< T >
 Template struct for making types serializable. More...
 

Macros

#define ADD_VAR(dict, var)   dict.add(#var, var)
 Macro for easily adding variables with the variable name as the key. More...
 
#define KV_ERROR(msg, errc)
 Throw an error. More...
 

Functions

size_t nextWord (size_t i)
 Get the offset of the next 4-byte word. More...
 
size_t roundUpToWordSizeMultiple (size_t i)
 Round up a size to a multiple of 4-byte words. More...
 

Detailed Description

Key-Value, dictionary-like datastructure.

Macro Definition Documentation

◆ ADD_VAR

#define ADD_VAR (   dict,
  var 
)    dict.add(#var, var)

Macro for easily adding variables with the variable name as the key.

Definition at line 448 of file KV_Builder.hpp.

◆ KV_ERROR

#define KV_ERROR (   msg,
  errc 
)
Value:
do { \
std::ostringstream s; \
s << __PRETTY_FUNCTION__ << ":" << __LINE__ << msg; \
throw KV_Exception(s.str(), errc); \
} while (0)

Throw an error.

Definition at line 26 of file KV_Error.hpp.

Function Documentation

◆ nextWord()

size_t nextWord ( size_t  i)
inline

Get the offset of the next 4-byte word.

in:   0  1  2  3  4  5  6  7  8  ...
out:  4  4  4  4  8  8  8  8  12 ... 

Definition at line 18 of file KV_Helpers.hpp.

◆ roundUpToWordSizeMultiple()

size_t roundUpToWordSizeMultiple ( size_t  i)
inline

Round up a size to a multiple of 4-byte words.

in:   0  1  2  3  4  5  6  7  8  9  ...
out:  0  4  4  4  4  8  8  8  8  12 ... 

Definition at line 24 of file KV_Helpers.hpp.

KV_Exception
Custom exception for KVComm. Not used on Arduino.
Definition: KV_Error.hpp:13