FluentLogger: fluent-logger-mbed A structured logger for Fluentd (mbed)
Dependents:
FluentLogger_Hello
SNIC-FluentLogger-example
« Back to documentation index
uMP Class Reference
Subset of MessagePack implementation.
More...
#include <uMP.h >
Public Member Functions
uMP ()
uMP
uMP (uint32_t size)
uMP
void init ()
Initialize buffer pointer.
uint32_t get_size ()
Get message size.
uint8_t * get_buffer ()
Get message buffer pointer.
bool start_array (uint32_t size)
Start array format.
bool start_map (uint32_t size)
Start map format.
bool set_nil ()
Set NIL message.
bool set_true ()
Set TRUE message (bool family)
bool set_false ()
Set FALSE message (bool family)
bool set_uint (uint32_t u)
Set unsigned int message.
bool set_u8 (uint8_t u)
Set uint8 message.
bool set_u16 (uint16_t u)
Set uint16 message.
bool set_u32 (uint32_t u)
Set uint32 message.
bool set_u64 (uint64_t u)
Set uint64 message.
bool set_sint (int32_t i)
Set signed int message.
bool set_s8 (int8_t i)
Set int8 message.
bool set_s16 (int16_t i)
Set int16 message.
bool set_s32 (int32_t i)
Set int32 message.
bool set_s64 (int64_t i)
Set int64 message.
bool set_float (float f)
Set float(32bit) message.
bool set_double (double d)
Set double(64bit) message.
bool set_str (const char *data, uint32_t size)
Set string message.
bool set_str (const std::string &str)
Set string message.
bool set_fixstr (const char *data, uint8_t size)
Set string message (upto 31 bytes)
bool set_str8 (const char *data, uint8_t size)
Set string message (upto 256 bytes)
bool set_raw (const char *data, uint8_t size)
Set raw message.
bool map (const std::string &k, bool v)
associate a key with value (bool)
bool map (const std::string &k, uint8_t v)
associate a key with value (uint8_t)
bool map (const std::string &k, uint16_t v)
associate a key with value (uint16_t)
bool map (const std::string &k, uint32_t v)
associate a key with value (uint32_t)
bool map (const std::string &k, int8_t v)
associate a key with value (int8_t)
bool map (const std::string &k, int16_t v)
associate a key with value (int16_t)
bool map (const std::string &k, int32_t v)
associate a key with value (int32_t)
bool map (const std::string &k, float v)
associate a key with value (float)
bool map (const std::string &k, double v)
associate a key with value (double)
bool map (const std::string &k, const char *v)
associate a key with value (char * string)
bool map (const std::string &k, const std::string &v)
associate a key with value (string)
Detailed Description
Subset of MessagePack implementation.
Definition at line 27 of file uMP.h .
Constructor & Destructor Documentation
uMP
(
uint32_t
size )
[explicit]
Member Function Documentation
Get message buffer pointer.
Returns: Pointer of message buffer
Definition at line 53 of file uMP.h .
Get message size.
Returns: message size(bytes)
Definition at line 47 of file uMP.h .
Initialize buffer pointer.
Definition at line 41 of file uMP.h .
bool map
(
const std::string &
k ,
const char *
v
)
associate a key with value (char * string)
Parameters:
Return values:
Definition at line 373 of file uMP.cpp .
bool map
(
const std::string &
k ,
int32_t
v
)
associate a key with value (int32_t)
Parameters:
Return values:
Definition at line 352 of file uMP.cpp .
bool map
(
const std::string &
k ,
float
v
)
associate a key with value (float)
Parameters:
Return values:
Definition at line 359 of file uMP.cpp .
bool map
(
const std::string &
k ,
int16_t
v
)
associate a key with value (int16_t)
Parameters:
Return values:
Definition at line 345 of file uMP.cpp .
bool map
(
const std::string &
k ,
double
v
)
associate a key with value (double)
Parameters:
Return values:
Definition at line 366 of file uMP.cpp .
bool map
(
const std::string &
k ,
const std::string &
v
)
associate a key with value (string)
Parameters:
Return values:
Definition at line 380 of file uMP.cpp .
bool map
(
const std::string &
k ,
bool
v
)
associate a key with value (bool)
Parameters:
k key string
v bool value(true/false)
Return values:
bool map
(
const std::string &
k ,
uint8_t
v
)
associate a key with value (uint8_t)
Parameters:
Return values:
Definition at line 317 of file uMP.cpp .
bool map
(
const std::string &
k ,
uint16_t
v
)
associate a key with value (uint16_t)
Parameters:
Return values:
Definition at line 324 of file uMP.cpp .
bool map
(
const std::string &
k ,
uint32_t
v
)
associate a key with value (uint32_t)
Parameters:
Return values:
Definition at line 331 of file uMP.cpp .
bool map
(
const std::string &
k ,
int8_t
v
)
associate a key with value (int8_t)
Parameters:
Return values:
Definition at line 338 of file uMP.cpp .
bool set_double
(
double
d )
Set double(64bit) message.
Parameters:
Return values:
Definition at line 254 of file uMP.cpp .
Set FALSE message (bool family)
Return values:
Definition at line 48 of file uMP.cpp .
bool set_fixstr
(
const char *
data ,
uint8_t
size
)
Set string message (upto 31 bytes)
Parameters:
data Pointer of message string
size Size of message string (max 31 bytes)
Return values:
Definition at line 203 of file uMP.cpp .
bool set_float
(
float
f )
Set float(32bit) message.
Parameters:
Return values:
Definition at line 242 of file uMP.cpp .
Set NIL message.
Return values:
Definition at line 38 of file uMP.cpp .
bool set_raw
(
const char *
data ,
uint8_t
size
)
Set raw message.
Insert the pre build message into buffer. This function is not MessagePack standard.
Parameters:
data Pointer of message string
size Size of message string
Return values:
Definition at line 234 of file uMP.cpp .
bool set_s16
(
int16_t
i )
Set int16 message.
Parameters:
Return values:
Definition at line 157 of file uMP.cpp .
bool set_s32
(
int32_t
i )
Set int32 message.
Parameters:
Return values:
Definition at line 167 of file uMP.cpp .
bool set_s64
(
int64_t
i )
Set int64 message.
Parameters:
Return values:
Definition at line 177 of file uMP.cpp .
Set int8 message.
Parameters:
Return values:
Definition at line 149 of file uMP.cpp .
bool set_sint
(
int32_t
i )
Set signed int message.
Auto route the optimal function.
Parameters:
s signed int value(max 32bit)
Return values:
Definition at line 129 of file uMP.cpp .
bool set_str
(
const char *
data ,
uint32_t
size
)
Set string message.
Auto route the optimal function.
Parameters:
data Pointer of message string
size Size of message string (max 255 bytes)
Return values:
Definition at line 187 of file uMP.cpp .
bool set_str
(
const std::string &
str )
Set string message.
Auto route the optimal function.
Parameters:
str string of message string
Return values:
Definition at line 198 of file uMP.cpp .
bool set_str8
(
const char *
data ,
uint8_t
size
)
Set string message (upto 256 bytes)
Parameters:
data Pointer of message string
size Size of message string (max 255 bytes)
Return values:
Definition at line 217 of file uMP.cpp .
Set TRUE message (bool family)
Return values:
Definition at line 43 of file uMP.cpp .
bool set_u16
(
uint16_t
u )
Set uint16 message.
Parameters:
Return values:
Definition at line 99 of file uMP.cpp .
bool set_u32
(
uint32_t
u )
Set uint32 message.
Parameters:
Return values:
Definition at line 109 of file uMP.cpp .
bool set_u64
(
uint64_t
u )
Set uint64 message.
Parameters:
Return values:
Definition at line 119 of file uMP.cpp .
bool set_u8
(
uint8_t
u )
Set uint8 message.
Parameters:
Return values:
Definition at line 91 of file uMP.cpp .
bool set_uint
(
uint32_t
u )
Set unsigned int message.
Auto route the optimal function.
Parameters:
u unsigned int value(max 32bit)
Return values:
Definition at line 74 of file uMP.cpp .
bool start_array
(
uint32_t
size )
Start array format.
Parameters:
size Number of array elements
Return values:
Definition at line 53 of file uMP.cpp .
bool start_map
(
uint32_t
size )
Start map format.
Parameters:
Return values:
Definition at line 61 of file uMP.cpp .