OnixS C++ CME MDP Streamlined Market Data Handler  1.2.0
API Documentation
HandlerDebugLogging.h
Go to the documentation of this file.
1 // Copyright Onix Solutions Limited [OnixS]. All rights reserved.
2 //
3 // This software owned by Onix Solutions Limited [OnixS] and is
4 // protected by copyright law and international copyright treaties.
5 //
6 // Access to and use of the software is governed by the terms of the applicable
7 // OnixS Software Services Agreement (the Agreement) and Customer end user license
8 // agreements granting a non-assignable, non-transferable and non-exclusive license
9 // to use the software for it's own data processing purposes under the terms defined
10 // in the Agreement.
11 //
12 // Except as otherwise granted within the terms of the Agreement, copying or
13 // reproduction of any part of this source code or associated reference material
14 // to any other location for further reproduction or redistribution, and any
15 // amendments to this copyright notice, are expressly prohibited.
16 //
17 // Any reproduction or redistribution for sale or hiring of the Software not in
18 // accordance with the terms of the Agreement is a violation of copyright law.
19 //
20 
21 #pragma once
22 
25 
27 
28 /// Defines how SBE messages are traced.
30 {
31  /// Integral type used as basement for constants.
32  typedef UInt32 Base;
33 
34  /// Defines how SBE messages are traced.
35  enum Enum
36  {
37  /// Message tracing is disabled.
39 
40  /// Messages are traced using SBE naming from
41  /// coding templates for fields and their values.
43 
44  /// Messages are traced in FIX tag=value format.
45  FixFormat
46  };
47 };
48 
49 /// Serializes message tracing constant into a string.
51 void
52 toStr(
53  std::string&,
55 
56 /// Serializes message tracing constant into a string.
57 inline
58 std::string
60  MessageTracing::Enum tracing)
61 {
62  std::string str;
63 
64  toStr(str, tracing);
65 
66  return str;
67 }
68 
69 /// Deserializes message tracing constant from a string.
71 bool
72 fromStr(
74  const Char*,
75  size_t);
76 
77 /// Parameters affecting what's logged at a debug level.
79 {
80  bool traceFeeds_;
81  MessageTracing::Enum traceMessages_;
82  bool traceBooks_;
83 
84 public:
85  /// Initializes default settings.
87  : traceFeeds_(false)
88  , traceMessages_(
89  MessageTracing::Disabled)
90  , traceBooks_(false)
91  {
92  }
93 
94  /// Cleans everything up (if necessary).
96  {
97  }
98 
99  /// Defines whether feeds are to be traced.
100  /// @note By default, feeds are not traced.
101  bool traceFeeds() const
102  {
103  return traceFeeds_;
104  }
105 
106  /// Defines whether feeds are to be traced.
107  void traceFeeds(bool status)
108  {
109  traceFeeds_ = status;
110  }
111 
112  /// Defines the way SBE messages are traced.
113  /// @note By default, messages are not traced.
115  {
116  return traceMessages_;
117  }
118 
119  /// Defines the way SBE messages are traced.
120  void
122  MessageTracing::Enum tracing)
123  {
124  traceMessages_ = tracing;
125  }
126 
127  /// Indicates whether books are traced.
128  /// @note By default, books are not traced.
129  bool traceBooks() const
130  {
131  return traceBooks_;
132  }
133 
134  /// Indicates whether books are traced.
135  void
137  bool status)
138  {
139  traceBooks_ = status;
140  }
141 };
142 
143 /// Serializes Handler debug logging settings into a string.
145 void
146 toStr(
147  std::string&,
148  const
150 
151 /// Serializes Handler debug logging settings into a string.
152 inline
153 std::string
155  const
156  HandlerDebugLoggingSettings& settings)
157 {
158  std::string str;
159 
160  toStr(str, settings);
161 
162  return str;
163 }
164 
Defines how SBE messages are traced.
Parameters affecting what's logged at a debug level.
void traceBooks(bool status)
Indicates whether books are traced.
MessageTracing::Enum traceMessages() const
Defines the way SBE messages are traced.
bool fromStr(MessageTracing::Enum &, const Char *, size_t)
Deserializes message tracing constant from a string.
std::string toStr(const HandlerDebugLoggingSettings &settings)
Serializes Handler debug logging settings into a string.
void traceMessages(MessageTracing::Enum tracing)
Defines the way SBE messages are traced.
#define ONIXS_CMESTREAMLINEDMDH_NAMESPACE_END
Definition: Bootstrap.h:173
#define ONIXS_CMESTREAMLINEDMDH_LTWT_CLASS
Definition: Bootstrap.h:111
#define ONIXS_CMESTREAMLINEDMDH_EXPORTED
Definition: Compiler.h:160
~HandlerDebugLoggingSettings()
Cleans everything up (if necessary).
char Char
Character type alias.
Definition: String.h:36
Messages are traced using SBE naming from coding templates for fields and their values.
bool traceFeeds() const
Defines whether feeds are to be traced.
Enum
Defines how SBE messages are traced.
void traceFeeds(bool status)
Defines whether feeds are to be traced.
bool traceBooks() const
Indicates whether books are traced.
#define ONIXS_CMESTREAMLINEDMDH_LTWT_STRUCT
Definition: Bootstrap.h:115
UInt32 Base
Integral type used as basement for constants.
UInt32 UInt32
uInt32.
Definition: Fields.h:183
#define ONIXS_CMESTREAMLINEDMDH_NAMESPACE_BEGIN
Definition: Bootstrap.h:169