OnixS C++ SGX Titan ITCH Market Data Handler  1.2.2
API documentation
SerializationUtils.h File Reference
#include <stdexcept>
#include <sstream>
#include <OnixS/SgxTitan/MarketData/Itch/String.h>
#include "NamespaceHelper.h"

Go to the source code of this file.

Namespaces

 OnixS
 
 OnixS::SgxTitan
 
 OnixS::SgxTitan::MarketData
 
 OnixS::SgxTitan::MarketData::Itch
 

Macros

#define ONIXS_ENUM_TO_STR_BEGIN(Enumeration)
 
#define ONIXS_ENUM_TO_STR_ENTRY(Value)
 
#define ONIXS_ENUM_TO_STR_CUSTOM_ENTRY(Value, Str)
 
#define ONIXS_ENUM_TO_STR_END(Enumeration)
 
#define ONIXS_STR_TO_ENUM_BEGIN(Enumeration)
 
#define ONIXS_STR_TO_ENUM_ENTRY(Value)
 
#define ONIXS_STR_TO_ENUM_CUSTOM_ENTRY(Value, Str)
 
#define ONIXS_STR_TO_ENUM_END(Enumeration)
 
#define ONIXS_FROM_STR_BEGIN(Enumeration)
 
#define ONIXS_FROM_STR_ENTRY(Value)
 
#define ONIXS_FROM_STR_CUSTOM_ENTRY(Value, Str)
 
#define ONIXS_FROM_STR_END(Enumeration)
 
#define ONIXS_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 constant)
 

Macro Definition Documentation

#define ONIXS_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_ITCH_API void toStr(std::string &, MessageType::Enum)
Appends string presentation of object.

Definition at line 234 of file SerializationUtils.h.

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

Definition at line 128 of file SerializationUtils.h.

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

Definition at line 148 of file SerializationUtils.h.

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

Definition at line 154 of file SerializationUtils.h.

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

Definition at line 142 of file SerializationUtils.h.

#define ONIXS_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:37

Definition at line 197 of file SerializationUtils.h.

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

Definition at line 220 of file SerializationUtils.h.

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

Definition at line 229 of file SerializationUtils.h.

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

Definition at line 211 of file SerializationUtils.h.

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

Definition at line 165 of file SerializationUtils.h.

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

Definition at line 180 of file SerializationUtils.h.

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

Definition at line 185 of file SerializationUtils.h.

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

Definition at line 175 of file SerializationUtils.h.