Value Class Reference

#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
Valueoperator[] (const std::string &key)
Valueoperator[] (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, ValueasObject ()
std::vector< ValueasArray ()

Detailed Description

Represents a value in the serialization.

Definition at line 178 of file lsm_ipc.hpp.


Member Enumeration Documentation

enum value_type

Different types this class can hold.

Enumerator:
null_t 
boolean_t 
string_t 
numeric_t 
object_t 
array_t 

Definition at line 184 of file lsm_ipc.hpp.


Constructor & Destructor Documentation

Value ( void   ) 

Default constructor creates a "null" type

Definition at line 214 of file lsm_ipc.cpp.

Here is the caller graph for this function:

Value ( bool  v  ) 

Boolean constructor

Parameters:
v value

Definition at line 218 of file lsm_ipc.cpp.

Value ( double  v  ) 

Numeric double constructor.

Parameters:
v value

Definition at line 222 of file lsm_ipc.cpp.

Value ( long double  v  ) 

Definition at line 226 of file lsm_ipc.cpp.

Value ( uint32_t  v  ) 

Numeric unsigned 32 constructor

Parameters:
v value

Definition at line 230 of file lsm_ipc.cpp.

Value ( int32_t  v  ) 

Numeric signed 32 constructor

Parameters:
v value

Definition at line 234 of file lsm_ipc.cpp.

Value ( uint64_t  v  ) 

Numeric unsigned 64 constructor.

Parameters:
v value

Definition at line 238 of file lsm_ipc.cpp.

Value ( int64_t  v  ) 

Numeric signed 64 constructor.

Parameters:
v value

Definition at line 242 of file lsm_ipc.cpp.

Value ( value_type  type,
const std::string &  v 
)

Constructor in which you specify type and initial value as string.

Parameters:
type Type this object will hold.
v value

Definition at line 246 of file lsm_ipc.cpp.

Value ( const char *  v  ) 

Constructor for char * i.e. string.

Parameters:
v value

Definition at line 254 of file lsm_ipc.cpp.

Value ( const std::string &  v  ) 

Constructor for std::string

Parameters:
v value

Definition at line 264 of file lsm_ipc.cpp.

Value ( const std::map< std::string, Value > &  v  ) 

Constructor for object type

Parameters:
v values

Definition at line 268 of file lsm_ipc.cpp.

Value ( const std::vector< Value > &  v  ) 

Constructor for array type

Parameters:
v array values

Definition at line 250 of file lsm_ipc.cpp.


Member Function Documentation

std::vector< Value > asArray (  ) 

vector of values represented by object.

Returns:
vector of array values else ValueException on error

Definition at line 475 of file lsm_ipc.cpp.

Here is the caller graph for this function:

bool asBool (  ) 

Boolean value represented by object.

Returns:
true, false ValueException on error

Definition at line 364 of file lsm_ipc.cpp.

const char * asC_str (  ) 

Return string as a pointer to a character array

Returns:

Definition at line 457 of file lsm_ipc.cpp.

Here is the caller graph for this function:

double asDouble (  ) 

Double value represented by object.

Returns:
double value else ValueException on error

Definition at line 372 of file lsm_ipc.cpp.

int32_t asInt32_t (  ) 

Signed 32 integer value represented by object.

Returns:
integer value else ValueException on error

Definition at line 398 of file lsm_ipc.cpp.

int64_t asInt64_t (  ) 

Signed 64 integer value represented by object.

Returns:
integer value else ValueException on error

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.

Returns:
map of key and values else ValueException on error

Definition at line 467 of file lsm_ipc.cpp.

Here is the caller graph for this function:

std::string asString (  ) 

String value represented by object.

Returns:
string value else ValueException on error

Definition at line 447 of file lsm_ipc.cpp.

uint32_t asUint32_t (  ) 

Unsigned 32 integer value represented by object.

Returns:
integer value else ValueException on error

Definition at line 423 of file lsm_ipc.cpp.

Here is the caller graph for this function:

uint64_t asUint64_t (  ) 

Unsigned 64 integer value represented by object.

Returns:
integer value else ValueException on error

Definition at line 435 of file lsm_ipc.cpp.

void * asVoid (  ) 

Returns NULL if void type, else ValueException

Returns:
NULL

Definition at line 356 of file lsm_ipc.cpp.

Value getValue ( const char *  key  ) 

Given a key returns the value.

Parameters:
key 
Returns:
Value

Definition at line 338 of file lsm_ipc.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

bool hasKey ( const std::string &  k  ) 

Returns true if value has a key in key/value pair

Returns:
true if key exists, else false.

Definition at line 321 of file lsm_ipc.cpp.

Here is the caller graph for this function:

bool isValidRequest ( void   ) 

Checks to see if a Value contains a valid request

Returns:
True if it is a request, else false

Definition at line 332 of file lsm_ipc.cpp.

Here is the call graph for this function:

Value & operator[] ( uint32_t  i  ) 

Overloaded operator for vector(array) access

Parameters:
i 
Returns:
Value

Definition at line 314 of file lsm_ipc.cpp.

Value & operator[] ( const std::string &  key  ) 

Overloaded operator for map access

Parameters:
key 
Returns:
Value

Definition at line 307 of file lsm_ipc.cpp.

std::string serialize ( void   ) 

Serialize Value to json

Returns:

Definition at line 272 of file lsm_ipc.cpp.

Here is the caller graph for this function:

Value::value_type valueType (  )  const

Returns the enumerated type represented by object

Returns:
enumerated type

Definition at line 302 of file lsm_ipc.cpp.

Here is the caller graph for this function:


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

Generated on 9 Jul 2015 for libStorageMgmt by  doxygen 1.6.1