OSVR-Core
Classes | Namespaces | Macros | Functions
GetOptionalParameter.h File Reference

Header. More...

#include <json/value.h>

Go to the source code of this file.

Classes

struct  osvr::vbtracker::detail::JsonTypeGetter< T >
 

Namespaces

 osvr
 The main namespace for all C++ elements of the framework, internal and external.
 

Macros

#define OSVR_DECLARE_JSON_TYPE_GETTER(TYPENAME, METHOD)
 

Functions

template<typename T >
T osvr::vbtracker::json_cast (Json::Value const &val)
 
template<typename T >
void osvr::vbtracker::getOptionalParameter (T &dest, Json::Value const &obj, const char *key)
 Gets an optional parameter from a JSON object: if it's not present, the existing value is left there. More...
 
template<typename T , Json::Value::ArrayIndex N>
void osvr::vbtracker::getOptionalParameter (T(&dest)[N], Json::Value const &obj, const char *key)
 Gets an optional array parameter from a JSON object: if it's not present and the exact size, the existing value is left there. More...
 

Detailed Description

Header.

Date
2015
Author
Sensics, Inc. http://sensics.com/osvr

Macro Definition Documentation

§ OSVR_DECLARE_JSON_TYPE_GETTER

#define OSVR_DECLARE_JSON_TYPE_GETTER (   TYPENAME,
  METHOD 
)
Value:
template <> struct JsonTypeGetter<TYPENAME> { \
static TYPENAME apply(Json::Value const &val) { return val.METHOD(); } \
};
typename F::template apply< Args... > apply
Apply an alias class.
Definition: Apply.h:44

Function Documentation

§ getOptionalParameter() [1/2]

template<typename T >
void osvr::vbtracker::getOptionalParameter ( T dest,
Json::Value const &  obj,
const char *  key 
)
inline

Gets an optional parameter from a JSON object: if it's not present, the existing value is left there.

§ getOptionalParameter() [2/2]

template<typename T , Json::Value::ArrayIndex N>
void osvr::vbtracker::getOptionalParameter ( T(&)  dest[N],
Json::Value const &  obj,
const char *  key 
)
inline

Gets an optional array parameter from a JSON object: if it's not present and the exact size, the existing value is left there.