OnixS C++ SGX Titan OUCH Trading Handler  1.2.0
API documentation
SerializationUtils.h File Reference
#include <stdexcept>
#include <sstream>
#include <OnixS/SgxTitan/Trading/OUCH/String.h>

Go to the source code of this file.

Namespaces

 OnixS
 
 OnixS::SgxTitan
 
 OnixS::SgxTitan::Trading
 
 OnixS::SgxTitan::Trading::Ouch
 

Macros

#define ONIXS_SGXTITAN_OUCH_ENUM_TO_STR_BEGIN(Enumeration)
 
#define ONIXS_SGXTITAN_OUCH_ENUM_TO_STR_ENTRY(Value)
 
#define ONIXS_SGXTITAN_OUCH_ENUM_TO_STR_CUSTOM_ENTRY(Value, Str)
 
#define ONIXS_SGXTITAN_OUCH_ENUM_TO_STR_END(Enumeration)
 
#define ONIXS_SGXTITAN_OUCH_STR_TO_ENUM_BEGIN(Enumeration)
 
#define ONIXS_SGXTITAN_OUCH_STR_TO_ENUM_ENTRY(Value)
 
#define ONIXS_SGXTITAN_OUCH_STR_TO_ENUM_CUSTOM_ENTRY(Value, Str)
 
#define ONIXS_SGXTITAN_OUCH_STR_TO_ENUM_END(Enumeration)
 
#define ONIXS_SGXTITAN_OUCH_FROM_STR_BEGIN(Enumeration)
 
#define ONIXS_SGXTITAN_OUCH_FROM_STR_ENTRY(Value)
 
#define ONIXS_SGXTITAN_OUCH_FROM_STR_CUSTOM_ENTRY(Value, Str)
 
#define ONIXS_SGXTITAN_OUCH_FROM_STR_END(Enumeration)
 
#define ONIXS_SGXTITAN_OUCH_DECLARE_T0_STR_FUNCTIONS(Type)
 

Functions

void boolToStr (std::string &str, bool value)
 
template<class Item >
void itemToStr (std::string &str, const Item &item)
 
void itemToStr (std::string &str, const std::string &item)
 
template<class Iterator >
void containerToStr (std::string &str, Iterator containerBegin, Iterator containerEnd, const std::string &delimiter=",")
 
template<class Constant >
void throwOutOfEnumRange (const Char *enumeration, Constant)
 

Macro Definition Documentation

#define ONIXS_SGXTITAN_OUCH_DECLARE_T0_STR_FUNCTIONS (   Type)
Value:
void toStr(std::string&, Type);\
inline std::string toStr(Type value)\
{\
std::string str;\
toStr(str, value);\
return str;\
}
ONIXS_SGXTITAN_OUCH_API void toStr(std::string &, OutboundMessageTypes::Enum)
Appends string presentation of object.

Definition at line 232 of file SerializationUtils.h.

#define ONIXS_SGXTITAN_OUCH_ENUM_TO_STR_BEGIN (   Enumeration)
Value:
std::string& str, \
Enumeration::Enum value) \
{ \
typedef \
Enumeration \
Values; \
\
switch (value) \
{
ONIXS_SGXTITAN_OUCH_API void toStr(std::string &, OutboundMessageTypes::Enum)
Appends string presentation of object.

Definition at line 126 of file SerializationUtils.h.

#define ONIXS_SGXTITAN_OUCH_ENUM_TO_STR_CUSTOM_ENTRY (   Value,
  Str 
)
Value:
case Values::Value: \
str += (Str); \
break;

Definition at line 146 of file SerializationUtils.h.

#define ONIXS_SGXTITAN_OUCH_ENUM_TO_STR_END (   Enumeration)
Value:
default: \
std::stringstream ss;\
ss << value;\
str += "Undefined("; \
str += ss.str(); \
str += ")" ; \
} \
}

Definition at line 152 of file SerializationUtils.h.

#define ONIXS_SGXTITAN_OUCH_ENUM_TO_STR_ENTRY (   Value)
Value:
case Values::Value: \
str += #Value ; \
break;

Definition at line 140 of file SerializationUtils.h.

#define ONIXS_SGXTITAN_OUCH_FROM_STR_BEGIN (   Enumeration)
Value:
bool \
fromStr( \
Enumeration::Enum& value,\
const Char* str, \
size_t size) \
{ \
typedef \
Enumeration \
Values; \
\
const StrRef strRef(str, size);
char Char
Character type alias.
Definition: String.h:38

Definition at line 195 of file SerializationUtils.h.

#define ONIXS_SGXTITAN_OUCH_FROM_STR_CUSTOM_ENTRY (   Value,
  Str 
)
Value:
if (strRef == (Str)) \
{ \
value = Values::Value; \
\
return true; \
}

Definition at line 218 of file SerializationUtils.h.

#define ONIXS_SGXTITAN_OUCH_FROM_STR_END (   Enumeration)
Value:
return false; \
}

Definition at line 227 of file SerializationUtils.h.

#define ONIXS_SGXTITAN_OUCH_FROM_STR_ENTRY (   Value)
Value:
if (strRef == #Value) \
{ \
value = Values::Value; \
\
return true; \
}

Definition at line 209 of file SerializationUtils.h.

#define ONIXS_SGXTITAN_OUCH_STR_TO_ENUM_BEGIN (   Enumeration)
Value:
Enumeration::Enum \
strTo##Enumeration( \
const std::string& str) \
{ \
typedef \
Enumeration \
Values;

Definition at line 163 of file SerializationUtils.h.

#define ONIXS_SGXTITAN_OUCH_STR_TO_ENUM_CUSTOM_ENTRY (   Value,
  Str 
)
Value:
if (str == (Str)) \
return Values::Value;

Definition at line 178 of file SerializationUtils.h.

#define ONIXS_SGXTITAN_OUCH_STR_TO_ENUM_END (   Enumeration)
Value:
#Enumeration, \
str); \
\
return \
static_cast \
<Enumeration::Enum> \
(0); \
}
void throwOutOfEnumRange(const Char *enumeration, Constant)

Definition at line 183 of file SerializationUtils.h.

#define ONIXS_SGXTITAN_OUCH_STR_TO_ENUM_ENTRY (   Value)
Value:
if (str == #Value) \
return Values::Value;

Definition at line 173 of file SerializationUtils.h.