Go to the source code of this file.
#define _cmnDataFunctionsEnumMacros_h |
#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