quickfix_ruby_ud 2.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/ext/quickfix/Acceptor.cpp +257 -0
- data/ext/quickfix/Acceptor.h +127 -0
- data/ext/quickfix/Allocator.h +9 -0
- data/ext/quickfix/Application.h +137 -0
- data/ext/quickfix/DOMDocument.h +70 -0
- data/ext/quickfix/DataDictionary.cpp +679 -0
- data/ext/quickfix/DataDictionary.h +607 -0
- data/ext/quickfix/DataDictionaryProvider.cpp +66 -0
- data/ext/quickfix/DataDictionaryProvider.h +67 -0
- data/ext/quickfix/DatabaseConnectionID.h +98 -0
- data/ext/quickfix/DatabaseConnectionPool.h +84 -0
- data/ext/quickfix/Dictionary.cpp +157 -0
- data/ext/quickfix/Dictionary.h +89 -0
- data/ext/quickfix/Event.h +89 -0
- data/ext/quickfix/Except.h +39 -0
- data/ext/quickfix/Exceptions.h +257 -0
- data/ext/quickfix/Field.h +654 -0
- data/ext/quickfix/FieldConvertors.cpp +86 -0
- data/ext/quickfix/FieldConvertors.h +800 -0
- data/ext/quickfix/FieldMap.cpp +254 -0
- data/ext/quickfix/FieldMap.h +327 -0
- data/ext/quickfix/FieldNumbers.h +44 -0
- data/ext/quickfix/FieldTypes.cpp +62 -0
- data/ext/quickfix/FieldTypes.h +817 -0
- data/ext/quickfix/Fields.h +30 -0
- data/ext/quickfix/FileLog.cpp +176 -0
- data/ext/quickfix/FileLog.h +110 -0
- data/ext/quickfix/FileStore.cpp +369 -0
- data/ext/quickfix/FileStore.h +131 -0
- data/ext/quickfix/FixCommonFields.h +13 -0
- data/ext/quickfix/FixFieldNumbers.h +6132 -0
- data/ext/quickfix/FixFields.h +6133 -0
- data/ext/quickfix/FixValues.h +5790 -0
- data/ext/quickfix/Group.cpp +44 -0
- data/ext/quickfix/Group.h +78 -0
- data/ext/quickfix/HostDetailsProvider.cpp +79 -0
- data/ext/quickfix/HostDetailsProvider.h +44 -0
- data/ext/quickfix/HtmlBuilder.h +178 -0
- data/ext/quickfix/HttpConnection.cpp +914 -0
- data/ext/quickfix/HttpConnection.h +74 -0
- data/ext/quickfix/HttpMessage.cpp +229 -0
- data/ext/quickfix/HttpMessage.h +112 -0
- data/ext/quickfix/HttpParser.cpp +49 -0
- data/ext/quickfix/HttpParser.h +49 -0
- data/ext/quickfix/HttpServer.cpp +152 -0
- data/ext/quickfix/HttpServer.h +76 -0
- data/ext/quickfix/Initiator.cpp +310 -0
- data/ext/quickfix/Initiator.h +151 -0
- data/ext/quickfix/Log.cpp +71 -0
- data/ext/quickfix/Log.h +254 -0
- data/ext/quickfix/Message.cpp +617 -0
- data/ext/quickfix/Message.h +419 -0
- data/ext/quickfix/MessageCracker.h +171 -0
- data/ext/quickfix/MessageSorters.cpp +101 -0
- data/ext/quickfix/MessageSorters.h +185 -0
- data/ext/quickfix/MessageStore.cpp +182 -0
- data/ext/quickfix/MessageStore.h +164 -0
- data/ext/quickfix/Mutex.h +120 -0
- data/ext/quickfix/MySQLConnection.h +187 -0
- data/ext/quickfix/MySQLLog.cpp +262 -0
- data/ext/quickfix/MySQLLog.h +158 -0
- data/ext/quickfix/MySQLStore.cpp +323 -0
- data/ext/quickfix/MySQLStore.h +161 -0
- data/ext/quickfix/MySQLStubs.h +203 -0
- data/ext/quickfix/NullStore.cpp +40 -0
- data/ext/quickfix/NullStore.h +89 -0
- data/ext/quickfix/OdbcConnection.h +241 -0
- data/ext/quickfix/OdbcLog.cpp +230 -0
- data/ext/quickfix/OdbcLog.h +109 -0
- data/ext/quickfix/OdbcStore.cpp +313 -0
- data/ext/quickfix/OdbcStore.h +124 -0
- data/ext/quickfix/PUGIXML_DOMDocument.cpp +112 -0
- data/ext/quickfix/PUGIXML_DOMDocument.h +81 -0
- data/ext/quickfix/Parser.cpp +111 -0
- data/ext/quickfix/Parser.h +50 -0
- data/ext/quickfix/PostgreSQLConnection.h +163 -0
- data/ext/quickfix/PostgreSQLLog.cpp +263 -0
- data/ext/quickfix/PostgreSQLLog.h +157 -0
- data/ext/quickfix/PostgreSQLStore.cpp +327 -0
- data/ext/quickfix/PostgreSQLStore.h +160 -0
- data/ext/quickfix/PostgreSQLStubs.h +203 -0
- data/ext/quickfix/Queue.h +66 -0
- data/ext/quickfix/QuickfixRuby.cpp +131900 -0
- data/ext/quickfix/QuickfixRuby.h +56 -0
- data/ext/quickfix/Responder.h +41 -0
- data/ext/quickfix/SSLSocketAcceptor.cpp +409 -0
- data/ext/quickfix/SSLSocketAcceptor.h +186 -0
- data/ext/quickfix/SSLSocketConnection.cpp +434 -0
- data/ext/quickfix/SSLSocketConnection.h +221 -0
- data/ext/quickfix/SSLSocketInitiator.cpp +558 -0
- data/ext/quickfix/SSLSocketInitiator.h +203 -0
- data/ext/quickfix/SSLStubs.h +129 -0
- data/ext/quickfix/Session.cpp +1437 -0
- data/ext/quickfix/Session.h +343 -0
- data/ext/quickfix/SessionFactory.cpp +314 -0
- data/ext/quickfix/SessionFactory.h +84 -0
- data/ext/quickfix/SessionID.h +136 -0
- data/ext/quickfix/SessionSettings.cpp +165 -0
- data/ext/quickfix/SessionSettings.h +283 -0
- data/ext/quickfix/SessionState.h +260 -0
- data/ext/quickfix/Settings.cpp +160 -0
- data/ext/quickfix/Settings.h +56 -0
- data/ext/quickfix/SharedArray.h +274 -0
- data/ext/quickfix/SocketAcceptor.cpp +216 -0
- data/ext/quickfix/SocketAcceptor.h +77 -0
- data/ext/quickfix/SocketConnection.cpp +256 -0
- data/ext/quickfix/SocketConnection.h +102 -0
- data/ext/quickfix/SocketConnector.cpp +112 -0
- data/ext/quickfix/SocketConnector.h +76 -0
- data/ext/quickfix/SocketInitiator.cpp +241 -0
- data/ext/quickfix/SocketInitiator.h +76 -0
- data/ext/quickfix/SocketMonitor.h +26 -0
- data/ext/quickfix/SocketMonitor_UNIX.cpp +238 -0
- data/ext/quickfix/SocketMonitor_UNIX.h +101 -0
- data/ext/quickfix/SocketMonitor_WIN32.cpp +248 -0
- data/ext/quickfix/SocketMonitor_WIN32.h +99 -0
- data/ext/quickfix/SocketServer.cpp +163 -0
- data/ext/quickfix/SocketServer.h +100 -0
- data/ext/quickfix/ThreadedSSLSocketAcceptor.cpp +436 -0
- data/ext/quickfix/ThreadedSSLSocketAcceptor.h +209 -0
- data/ext/quickfix/ThreadedSSLSocketConnection.cpp +364 -0
- data/ext/quickfix/ThreadedSSLSocketConnection.h +191 -0
- data/ext/quickfix/ThreadedSSLSocketInitiator.cpp +434 -0
- data/ext/quickfix/ThreadedSSLSocketInitiator.h +193 -0
- data/ext/quickfix/ThreadedSocketAcceptor.cpp +242 -0
- data/ext/quickfix/ThreadedSocketAcceptor.h +95 -0
- data/ext/quickfix/ThreadedSocketConnection.cpp +227 -0
- data/ext/quickfix/ThreadedSocketConnection.h +89 -0
- data/ext/quickfix/ThreadedSocketInitiator.cpp +238 -0
- data/ext/quickfix/ThreadedSocketInitiator.h +78 -0
- data/ext/quickfix/TimeRange.cpp +227 -0
- data/ext/quickfix/TimeRange.h +215 -0
- data/ext/quickfix/Utility.cpp +639 -0
- data/ext/quickfix/Utility.h +255 -0
- data/ext/quickfix/UtilitySSL.cpp +1612 -0
- data/ext/quickfix/UtilitySSL.h +274 -0
- data/ext/quickfix/Values.h +63 -0
- data/ext/quickfix/config-all.h +10 -0
- data/ext/quickfix/config.h +10 -0
- data/ext/quickfix/config_unix.h +178 -0
- data/ext/quickfix/config_windows.h +0 -0
- data/ext/quickfix/dirent_windows.h +838 -0
- data/ext/quickfix/double-conversion/bignum-dtoa.cc +641 -0
- data/ext/quickfix/double-conversion/bignum-dtoa.h +84 -0
- data/ext/quickfix/double-conversion/bignum.cc +766 -0
- data/ext/quickfix/double-conversion/bignum.h +144 -0
- data/ext/quickfix/double-conversion/cached-powers.cc +176 -0
- data/ext/quickfix/double-conversion/cached-powers.h +64 -0
- data/ext/quickfix/double-conversion/diy-fp.cc +57 -0
- data/ext/quickfix/double-conversion/diy-fp.h +118 -0
- data/ext/quickfix/double-conversion/double-conversion.cc +994 -0
- data/ext/quickfix/double-conversion/double-conversion.h +543 -0
- data/ext/quickfix/double-conversion/fast-dtoa.cc +665 -0
- data/ext/quickfix/double-conversion/fast-dtoa.h +88 -0
- data/ext/quickfix/double-conversion/fixed-dtoa.cc +404 -0
- data/ext/quickfix/double-conversion/fixed-dtoa.h +56 -0
- data/ext/quickfix/double-conversion/ieee.h +402 -0
- data/ext/quickfix/double-conversion/strtod.cc +557 -0
- data/ext/quickfix/double-conversion/strtod.h +45 -0
- data/ext/quickfix/double-conversion/utils.h +374 -0
- data/ext/quickfix/extconf.rb +76 -0
- data/ext/quickfix/index.h +37 -0
- data/ext/quickfix/pugiconfig.hpp +77 -0
- data/ext/quickfix/pugixml.cpp +13237 -0
- data/ext/quickfix/pugixml.hpp +1516 -0
- data/ext/quickfix/scope_guard.hpp +215 -0
- data/ext/quickfix/stdint_msvc.h +254 -0
- data/ext/quickfix/strptime.h +7 -0
- data/lib/quickfix40.rb +274 -0
- data/lib/quickfix41.rb +351 -0
- data/lib/quickfix42.rb +1184 -0
- data/lib/quickfix43.rb +3504 -0
- data/lib/quickfix44.rb +14040 -0
- data/lib/quickfix50.rb +20051 -0
- data/lib/quickfix50sp1.rb +23596 -0
- data/lib/quickfix50sp2.rb +412444 -0
- data/lib/quickfix_fields.rb +79393 -0
- data/lib/quickfix_ruby.rb +82 -0
- data/lib/quickfixt11.rb +65 -0
- data/spec/FIX40.xml +862 -0
- data/spec/FIX41.xml +1282 -0
- data/spec/FIX42.xml +2743 -0
- data/spec/FIX43.xml +4230 -0
- data/spec/FIX44.xml +6600 -0
- data/spec/FIX50.xml +8142 -0
- data/spec/FIX50SP1.xml +9506 -0
- data/spec/FIX50SP2.xml +26069 -0
- data/spec/FIXT11.xml +252 -0
- data/test/DataDictionaryTestCase.rb +268 -0
- data/test/DictionaryTestCase.rb +112 -0
- data/test/FieldBaseTestCase.rb +24 -0
- data/test/MessageStoreTestCase.rb +19 -0
- data/test/MessageTestCase.rb +368 -0
- data/test/SessionSettingsTestCase.rb +41 -0
- metadata +236 -0
data/ext/quickfix/Log.h
ADDED
@@ -0,0 +1,254 @@
|
|
1
|
+
/* -*- C++ -*- */
|
2
|
+
|
3
|
+
/****************************************************************************
|
4
|
+
** Copyright (c) 2001-2014
|
5
|
+
**
|
6
|
+
** This file is part of the QuickFIX FIX Engine
|
7
|
+
**
|
8
|
+
** This file may be distributed under the terms of the quickfixengine.org
|
9
|
+
** license as defined by quickfixengine.org and appearing in the file
|
10
|
+
** LICENSE included in the packaging of this file.
|
11
|
+
**
|
12
|
+
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
13
|
+
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
14
|
+
**
|
15
|
+
** See http://www.quickfixengine.org/LICENSE for licensing information.
|
16
|
+
**
|
17
|
+
** Contact ask@quickfixengine.org if any conditions of this licensing are
|
18
|
+
** not clear to you.
|
19
|
+
**
|
20
|
+
****************************************************************************/
|
21
|
+
|
22
|
+
#ifndef FIX_LOG_H
|
23
|
+
#define FIX_LOG_H
|
24
|
+
|
25
|
+
#ifdef _MSC_VER
|
26
|
+
#pragma warning(disable : 4503 4355 4786 4290)
|
27
|
+
#endif
|
28
|
+
|
29
|
+
#include "Message.h"
|
30
|
+
#include "Mutex.h"
|
31
|
+
#include "SessionSettings.h"
|
32
|
+
|
33
|
+
#include <algorithm>
|
34
|
+
#include <map>
|
35
|
+
#include <utility>
|
36
|
+
#include <vector>
|
37
|
+
|
38
|
+
namespace FIX {
|
39
|
+
class Log;
|
40
|
+
|
41
|
+
/**
|
42
|
+
* This interface must be implemented to create a Log.
|
43
|
+
*/
|
44
|
+
class LogFactory {
|
45
|
+
public:
|
46
|
+
virtual ~LogFactory() = default;
|
47
|
+
virtual Log *create() = 0;
|
48
|
+
virtual Log *create(const SessionID &) = 0;
|
49
|
+
virtual void destroy(Log *) = 0;
|
50
|
+
};
|
51
|
+
|
52
|
+
/**
|
53
|
+
* Creates a screen based implementation of Log.
|
54
|
+
*
|
55
|
+
* This displays all log events onto the standard output
|
56
|
+
*/
|
57
|
+
class ScreenLogFactory : public LogFactory {
|
58
|
+
public:
|
59
|
+
explicit ScreenLogFactory(SessionSettings settings)
|
60
|
+
: m_useSettings(true),
|
61
|
+
m_settings(std::move(settings)) {};
|
62
|
+
ScreenLogFactory(bool incoming, bool outgoing, bool event)
|
63
|
+
: m_incoming(incoming),
|
64
|
+
m_outgoing(outgoing),
|
65
|
+
m_event(event),
|
66
|
+
m_useSettings(false) {}
|
67
|
+
|
68
|
+
/**
|
69
|
+
* \brief Create a new instance of the ScreenLog class.
|
70
|
+
*
|
71
|
+
* This function initializes the incoming, outgoing, and event variables based on the
|
72
|
+
* settings provided. It then creates a new instance of the ScreenLog class with the
|
73
|
+
* initialized variables and returns a pointer to it.
|
74
|
+
*
|
75
|
+
* \return A pointer to the created ScreenLog object.
|
76
|
+
*/
|
77
|
+
Log *create() override;
|
78
|
+
/**
|
79
|
+
* Creates a `Log` object for the given session ID.
|
80
|
+
* @param sessionID The session ID.
|
81
|
+
* @return A pointer to the created `Log` object.
|
82
|
+
*/
|
83
|
+
Log *create(const SessionID &) override;
|
84
|
+
/**
|
85
|
+
* @brief Destroy a Log object.
|
86
|
+
*
|
87
|
+
* This function destroys a Log object by deleting the dynamically allocated memory.
|
88
|
+
*
|
89
|
+
* @param pLog A pointer to the Log object to be destroyed.
|
90
|
+
* @return None
|
91
|
+
*/
|
92
|
+
void destroy(Log *log) override;
|
93
|
+
|
94
|
+
private:
|
95
|
+
/**
|
96
|
+
* @brief Initializes the screen logging settings.
|
97
|
+
*
|
98
|
+
* This function initializes the screen logging settings based on the provided dictionary.
|
99
|
+
* If m_useSettings is true, the settings from the dictionary are used to set the values of the incoming, outgoing,
|
100
|
+
* and event parameters. If m_useSettings is false, the values of incoming, outgoing, and event are set to the
|
101
|
+
* values of m_incoming, m_outgoing, and m_event respectively.
|
102
|
+
*
|
103
|
+
* @param settings The dictionary containing the screen logging settings.
|
104
|
+
* @param incoming A boolean reference to store the value of whether to show incoming log events.
|
105
|
+
* @param outgoing A boolean reference to store the value of whether to show outgoing log events.
|
106
|
+
* @param event A boolean reference to store the value of whether to show event log events.
|
107
|
+
*/
|
108
|
+
void init(const Dictionary &settings, bool &incoming, bool &outgoing, bool &event) const;
|
109
|
+
|
110
|
+
bool m_incoming{};
|
111
|
+
bool m_outgoing{};
|
112
|
+
bool m_event{};
|
113
|
+
bool m_useSettings;
|
114
|
+
SessionSettings m_settings;
|
115
|
+
};
|
116
|
+
|
117
|
+
/**
|
118
|
+
* This interface must be implemented to log messages and events
|
119
|
+
*/
|
120
|
+
class Log {
|
121
|
+
public:
|
122
|
+
virtual ~Log() = default;
|
123
|
+
|
124
|
+
virtual void clear() = 0;
|
125
|
+
virtual void backup() = 0;
|
126
|
+
virtual void onIncoming(const std::string &) = 0;
|
127
|
+
virtual void onOutgoing(const std::string &) = 0;
|
128
|
+
virtual void onEvent(const std::string &) = 0;
|
129
|
+
};
|
130
|
+
/*! @} */
|
131
|
+
|
132
|
+
/**
|
133
|
+
* Null implementation of Log
|
134
|
+
*
|
135
|
+
* This is only for internal use. Used when no log factory is
|
136
|
+
* passed to the initiator or acceptor.
|
137
|
+
*/
|
138
|
+
class NullLog : public Log {
|
139
|
+
public:
|
140
|
+
void clear() override {}
|
141
|
+
void backup() override {}
|
142
|
+
void onIncoming(const std::string &) override {}
|
143
|
+
void onOutgoing(const std::string &) override {}
|
144
|
+
void onEvent(const std::string &) override {}
|
145
|
+
};
|
146
|
+
|
147
|
+
/**
|
148
|
+
* Screen based implementation of Log.
|
149
|
+
*
|
150
|
+
* This will display all log information onto the standard output
|
151
|
+
*/
|
152
|
+
class ScreenLog : public Log {
|
153
|
+
public:
|
154
|
+
ScreenLog(bool incoming, bool outgoing, bool event)
|
155
|
+
: m_prefix("GLOBAL"),
|
156
|
+
m_incoming(incoming),
|
157
|
+
m_outgoing(outgoing),
|
158
|
+
m_event(event) {}
|
159
|
+
|
160
|
+
ScreenLog(const SessionID &sessionID, bool incoming, bool outgoing, bool event)
|
161
|
+
: m_prefix(sessionID.toString()),
|
162
|
+
m_incoming(incoming),
|
163
|
+
m_outgoing(outgoing),
|
164
|
+
m_event(event) {}
|
165
|
+
|
166
|
+
void clear() override {}
|
167
|
+
void backup() override {}
|
168
|
+
|
169
|
+
/**
|
170
|
+
* @brief Handles incoming messages.
|
171
|
+
*
|
172
|
+
* This function is called when an incoming message is received.
|
173
|
+
* It locks a mutex, retrieves the current timestamp, and prints the incoming message to the standard output.
|
174
|
+
*
|
175
|
+
* @param[in] value The incoming message.
|
176
|
+
*/
|
177
|
+
void onIncoming(const std::string &value) override {
|
178
|
+
if (!m_incoming) {
|
179
|
+
return;
|
180
|
+
}
|
181
|
+
Locker l(s_mutex);
|
182
|
+
m_time.setCurrent();
|
183
|
+
std::cout << "<" << UtcTimeStampConvertor::convert(m_time, 9) << ", " << m_prefix << ", " << "incoming>"
|
184
|
+
<< std::endl
|
185
|
+
<< " (" << replaceSOHWithPipe(value) << ")" << std::endl;
|
186
|
+
}
|
187
|
+
|
188
|
+
/**
|
189
|
+
* @brief Handles outgoing messages.
|
190
|
+
*
|
191
|
+
* This function is called when an outgoing message is sent. It prints the outgoing message to the standard output.
|
192
|
+
* The method first checks if outgoing logging is enabled. If not, it returns without performing any action.
|
193
|
+
* It locks a mutex to ensure thread safety, retrieves the current timestamp, and prints the outgoing message to the
|
194
|
+
* standard output.
|
195
|
+
*
|
196
|
+
* @param[in] value The outgoing message.
|
197
|
+
*
|
198
|
+
* @return void
|
199
|
+
*/
|
200
|
+
void onOutgoing(const std::string &value) override {
|
201
|
+
if (!m_outgoing) {
|
202
|
+
return;
|
203
|
+
}
|
204
|
+
Locker l(s_mutex);
|
205
|
+
m_time.setCurrent();
|
206
|
+
std::cout << "<" << UtcTimeStampConvertor::convert(m_time, 9) << ", " << m_prefix << ", " << "outgoing>"
|
207
|
+
<< std::endl
|
208
|
+
<< " (" << replaceSOHWithPipe(value) << ")" << std::endl;
|
209
|
+
}
|
210
|
+
|
211
|
+
/**
|
212
|
+
* Handles an event by printing the event details to the standard output.
|
213
|
+
*
|
214
|
+
* This function first checks if the m_event flag is set to true. If not,
|
215
|
+
* it returns without performing any action.
|
216
|
+
* It then locks a mutex to ensure thread safety, retrieves the current timestamp,
|
217
|
+
* and prints the event details to the standard output.
|
218
|
+
*
|
219
|
+
* @param[in] value The event details.
|
220
|
+
* @return void
|
221
|
+
*/
|
222
|
+
void onEvent(const std::string &value) override {
|
223
|
+
if (!m_event) {
|
224
|
+
return;
|
225
|
+
}
|
226
|
+
Locker l(s_mutex);
|
227
|
+
m_time.setCurrent();
|
228
|
+
std::cout << "<" << UtcTimeStampConvertor::convert(m_time, 9) << ", " << m_prefix << ", " << "event>" << std::endl
|
229
|
+
<< " (" << replaceSOHWithPipe(value) << ")" << std::endl;
|
230
|
+
}
|
231
|
+
|
232
|
+
private:
|
233
|
+
/**
|
234
|
+
* Replaces all occurrences of Start Of Header (SOH) character ('\001') in a given string with a pipe ('|')
|
235
|
+
* character.
|
236
|
+
*
|
237
|
+
* @param value The input string.
|
238
|
+
* @return The modified string with SOH replaced by pipe character.
|
239
|
+
*/
|
240
|
+
static std::string replaceSOHWithPipe(std::string value) {
|
241
|
+
std::replace(value.begin(), value.end(), '\001', '|');
|
242
|
+
return value;
|
243
|
+
}
|
244
|
+
|
245
|
+
std::string m_prefix;
|
246
|
+
UtcTimeStamp m_time = UtcTimeStamp::now();
|
247
|
+
bool m_incoming;
|
248
|
+
bool m_outgoing;
|
249
|
+
bool m_event;
|
250
|
+
static Mutex s_mutex;
|
251
|
+
};
|
252
|
+
} // namespace FIX
|
253
|
+
|
254
|
+
#endif // FIX_LOG_H
|