OnixS C++ SGX Titan OUCH Trading Handler  1.2.0
API documentation
Emumerations.Internal.cpp
Go to the documentation of this file.
1 /*
2 * Copyright Onix Solutions Limited [OnixS]. All rights reserved.
3 *
4 * This software owned by Onix Solutions Limited [OnixS] and is protected by copyright law
5 * and international copyright treaties.
6 *
7 * Access to and use of the software is governed by the terms of the applicable OnixS Software
8 * Services Agreement (the Agreement) and Customer end user license agreements granting
9 * a non-assignable, non-transferable and non-exclusive license to use the software
10 * for it's own data processing purposes under the terms defined in the Agreement.
11 *
12 * Except as otherwise granted within the terms of the Agreement, copying or reproduction of any part
13 * of this source code or associated reference material to any other location for further reproduction
14 * or redistribution, and any amendments to this copyright notice, are expressly prohibited.
15 *
16 * Any reproduction or redistribution for sale or hiring of the Software not in accordance with
17 * the terms of the Agreement is a violation of copyright law.
18 */
19 #include <sstream>
20 
25 
26 #include <util/Converter.h>
27 #include <util/String.h>
28 
29 #include "SerializationUtils.h"
30 
32 
33 std::string enumToString (LogLevel::Enum value)
34 {
35  switch (value)
36  {
37  case LogLevel::Fatal: return "Fatal";
38  case LogLevel::Error: return "Error";
39  case LogLevel::Warning: return "Warning";
40  case LogLevel::Info: return "Info";
41  case LogLevel::Trace: return "Trace";
42  case LogLevel::Debug: return "Debug";
43  default: return OnixS::Util::toValueString ("value", value);
44  }
45 }
46 
47 std::string enumToString (LogSettings::Enum value)
48 {
49  switch (value)
50  {
51  case LogSettings::NoTrace: return "NoTrace";
52  case LogSettings::Default: return "TraceToFile | TraceToConsole";
53  case LogSettings::TraceToFile: return "TraceToFile";
54  case LogSettings::TraceToConsole: return "TraceToConsole";
55  case LogSettings::Async: return "Async";
56  default: return "Combined (use bitsToString function)";
57  }
58 }
59 
60 std::string enumToString (ErrorCode::Enum value)
61 {
62  switch (value)
63  {
64  case ErrorCode::General: return "General";
65  default: return OnixS::Util::toValueString ("value", value);
66  }
67 }
68 
69 std::string enumToString (HandlerState::Enum value)
70 {
71  switch (value)
72  {
73  case HandlerState::Disconnected: return "Disconnected";
74  case HandlerState::Disconnecting: return "Disconnecting";
75  case HandlerState::Connecting: return "Connecting";
76  case HandlerState::Connected: return "Connected";
77  default: return OnixS::Util::toValueString ("value", value);
78  }
79 }
80 
81 std::ostream& operator<< (std::ostream &stream, HandlerState::Enum value)
82 {
83  stream << enumToString (value);
84  return stream;
85 }
86 
87 }}}}
Enum
Defines the state that the handler is in.
ONIXS_SGXTITAN_OUCH_API std::ostream & operator<<(std::ostream &stream, HandlerState::Enum value)
#define ONIXS_SGXTITAN_OUCH_NAMESPACE_BEGIN
Definition: Bootstrap.h:27
ONIXS_SGXTITAN_OUCH_API std::string enumToString(HandlerState::Enum)
Returns string representation of HandlerState value.
Enum
Known (selected) error codes.
Definition: ErrorListener.h:33