#include <lsm_ipc.hpp>
Public Types | |
enum | value_type { null_t, boolean_t, string_t, numeric_t, object_t, array_t } |
Public Member Functions | |
Value (void) | |
Value (bool v) | |
Value (double v) | |
Value (long double v) | |
Value (uint32_t v) | |
Value (int32_t v) | |
Value (uint64_t v) | |
Value (int64_t v) | |
Value (value_type type, const std::string &v) | |
Value (const char *v) | |
Value (const std::string &v) | |
Value (const std::map< std::string, Value > &v) | |
Value (const std::vector< Value > &v) | |
std::string | serialize (void) |
value_type | valueType () const |
Value & | operator[] (const std::string &key) |
Value & | operator[] (uint32_t i) |
bool | hasKey (const std::string &k) |
bool | isValidRequest (void) |
Value | getValue (const char *key) |
const char * | asNumString () |
void * | asVoid () |
bool | asBool () |
double | asDouble () |
long double | asLongDouble () |
int32_t | asInt32_t () |
int64_t | asInt64_t () |
uint32_t | asUint32_t () |
uint64_t | asUint64_t () |
std::string | asString () |
const char * | asC_str () |
std::map< std::string, Value > | asObject () |
std::vector< Value > | asArray () |
Represents a value in the serialization.
Definition at line 178 of file lsm_ipc.hpp.
enum value_type |
Different types this class can hold.
Definition at line 184 of file lsm_ipc.hpp.
Value | ( | void | ) |
Default constructor creates a "null" type
Definition at line 214 of file lsm_ipc.cpp.
Value | ( | bool | v | ) |
Value | ( | double | v | ) |
Value | ( | long double | v | ) |
Definition at line 226 of file lsm_ipc.cpp.
Value | ( | uint32_t | v | ) |
Value | ( | int32_t | v | ) |
Value | ( | uint64_t | v | ) |
Value | ( | int64_t | v | ) |
Value | ( | value_type | type, | |
const std::string & | v | |||
) |
Constructor in which you specify type and initial value as string.
type | Type this object will hold. | |
v | value |
Definition at line 246 of file lsm_ipc.cpp.
Value | ( | const char * | v | ) |
Value | ( | const std::string & | v | ) |
std::vector< Value > asArray | ( | ) |
vector of values represented by object.
Definition at line 475 of file lsm_ipc.cpp.
bool asBool | ( | ) |
Boolean value represented by object.
Definition at line 364 of file lsm_ipc.cpp.
const char * asC_str | ( | ) |
Return string as a pointer to a character array
Definition at line 457 of file lsm_ipc.cpp.
double asDouble | ( | ) |
Double value represented by object.
Definition at line 372 of file lsm_ipc.cpp.
int32_t asInt32_t | ( | ) |
Signed 32 integer value represented by object.
Definition at line 398 of file lsm_ipc.cpp.
int64_t asInt64_t | ( | ) |
Signed 64 integer value represented by object.
Definition at line 411 of file lsm_ipc.cpp.
long double asLongDouble | ( | ) |
Definition at line 385 of file lsm_ipc.cpp.
const char * asNumString | ( | ) |
Returns a numeric as the string holding it.
Definition at line 346 of file lsm_ipc.cpp.
std::map< std::string, Value > asObject | ( | ) |
key/value represented by object.
Definition at line 467 of file lsm_ipc.cpp.
std::string asString | ( | ) |
String value represented by object.
Definition at line 447 of file lsm_ipc.cpp.
uint32_t asUint32_t | ( | ) |
Unsigned 32 integer value represented by object.
Definition at line 423 of file lsm_ipc.cpp.
uint64_t asUint64_t | ( | ) |
Unsigned 64 integer value represented by object.
Definition at line 435 of file lsm_ipc.cpp.
void * asVoid | ( | ) |
Returns NULL if void type, else ValueException
Definition at line 356 of file lsm_ipc.cpp.
Value getValue | ( | const char * | key | ) |
Given a key returns the value.
key |
Definition at line 338 of file lsm_ipc.cpp.
bool hasKey | ( | const std::string & | k | ) |
Returns true if value has a key in key/value pair
Definition at line 321 of file lsm_ipc.cpp.
bool isValidRequest | ( | void | ) |
Checks to see if a Value contains a valid request
Definition at line 332 of file lsm_ipc.cpp.
Value & operator[] | ( | uint32_t | i | ) |
Overloaded operator for vector(array) access
i |
Definition at line 314 of file lsm_ipc.cpp.
Value & operator[] | ( | const std::string & | key | ) |
Overloaded operator for map access
key |
Definition at line 307 of file lsm_ipc.cpp.
std::string serialize | ( | void | ) |
Serialize Value to json
Definition at line 272 of file lsm_ipc.cpp.
Value::value_type valueType | ( | ) | const |
Returns the enumerated type represented by object
Definition at line 302 of file lsm_ipc.cpp.