cisst-saw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Macros
cmnDataFunctionsEnumMacros.h File Reference
#include <cisstCommon/cmnDataFunctions.h>

Go to the source code of this file.

Macros

#define _cmnDataFunctionsEnumMacros_h
 
#define CMN_DATA_SPECIALIZATION_FOR_ENUM_USER_HUMAN_READABLE(_enum, _promotedType, _humanReadableFunction)
 
#define CMN_DATA_SPECIALIZATION_FOR_ENUM(_enum, _promotedType)   CMN_DATA_SPECIALIZATION_FOR_ENUM_USER_HUMAN_READABLE(_enum, _promotedType, cmnData<int>::HumanReadable)
 
#define CMN_DECLARE_DATA_FUNCTIONS_JSON_FOR_ENUM(_enum)
 
#define CMN_IMPLEMENT_DATA_FUNCTIONS_JSON_FOR_ENUM(_enum, _promotedType)
 

Macro Definition Documentation

#define _cmnDataFunctionsEnumMacros_h
#define CMN_DATA_SPECIALIZATION_FOR_ENUM (   _enum,
  _promotedType 
)    CMN_DATA_SPECIALIZATION_FOR_ENUM_USER_HUMAN_READABLE(_enum, _promotedType, cmnData<int>::HumanReadable)
#define CMN_DATA_SPECIALIZATION_FOR_ENUM_USER_HUMAN_READABLE (   _enum,
  _promotedType,
  _humanReadableFunction 
)
#define CMN_DECLARE_DATA_FUNCTIONS_JSON_FOR_ENUM (   _enum)
Value:
template <> void cmnDataJSON<_enum>::SerializeText(const _enum & data, Json::Value & jsonValue); \
template <> void cmnDataJSON<_enum>::DeSerializeText(_enum & data, const Json::Value & jsonValue) throw (std::runtime_error);
#define CMN_IMPLEMENT_DATA_FUNCTIONS_JSON_FOR_ENUM (   _enum,
  _promotedType 
)
Value:
template <> void cmnDataJSON<_enum>::SerializeText(const _enum & data, Json::Value & jsonValue) { \
CMN_ASSERT(sizeof(_promotedType) >= sizeof(_enum)); \
const _promotedType dataPromoted = static_cast<_promotedType>(data); \
cmnDataJSON<_promotedType>::SerializeText(dataPromoted, jsonValue); \
} \
template <> void cmnDataJSON<_enum>::DeSerializeText(_enum & data, const Json::Value & jsonValue) throw (std::runtime_error) { \
CMN_ASSERT(sizeof(_promotedType) >= sizeof(_enum)); \
_promotedType dataPromoted; \
cmnDataJSON<_promotedType>::DeSerializeText(dataPromoted, jsonValue); \
data = static_cast<_enum>(dataPromoted); \
}
#define CMN_ASSERT(expr)
Definition: cmnAssert.h:90