quickfix_ruby_ud 2.0.7-x86_64-linux
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/2.4/quickfix.so +0 -0
- data/lib/2.5/quickfix.so +0 -0
- data/lib/2.6/quickfix.so +0 -0
- data/lib/2.7/quickfix.so +0 -0
- data/lib/3.0/quickfix.so +0 -0
- data/lib/3.1/quickfix.so +0 -0
- data/lib/3.2/quickfix.so +0 -0
- data/lib/3.3/quickfix.so +0 -0
- data/lib/3.4/quickfix.so +0 -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 +247 -0
@@ -0,0 +1,343 @@
|
|
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_SESSION_H
|
23
|
+
#define FIX_SESSION_H
|
24
|
+
|
25
|
+
#ifdef _MSC_VER
|
26
|
+
#pragma warning(disable : 4503 4355 4786 4290)
|
27
|
+
#endif
|
28
|
+
|
29
|
+
#include "Application.h"
|
30
|
+
#include "DataDictionaryProvider.h"
|
31
|
+
#include "Fields.h"
|
32
|
+
#include "Log.h"
|
33
|
+
#include "Mutex.h"
|
34
|
+
#include "Responder.h"
|
35
|
+
#include "SessionID.h"
|
36
|
+
#include "SessionState.h"
|
37
|
+
#include "TimeRange.h"
|
38
|
+
|
39
|
+
#include <functional>
|
40
|
+
#include <map>
|
41
|
+
#include <queue>
|
42
|
+
#include <utility>
|
43
|
+
|
44
|
+
namespace FIX {
|
45
|
+
/// Maintains the state and implements the logic of a %FIX %session.
|
46
|
+
class Session {
|
47
|
+
public:
|
48
|
+
Session(
|
49
|
+
std::function<UtcTimeStamp()> timestamper,
|
50
|
+
Application &,
|
51
|
+
MessageStoreFactory &,
|
52
|
+
const SessionID &,
|
53
|
+
const DataDictionaryProvider &,
|
54
|
+
const TimeRange &,
|
55
|
+
int heartBtInt,
|
56
|
+
LogFactory *pLogFactory);
|
57
|
+
virtual ~Session();
|
58
|
+
|
59
|
+
void logon() {
|
60
|
+
m_state.enabled(true);
|
61
|
+
m_state.logoutReason("");
|
62
|
+
}
|
63
|
+
void logout(const std::string &reason = "") {
|
64
|
+
m_state.enabled(false);
|
65
|
+
m_state.logoutReason(reason);
|
66
|
+
}
|
67
|
+
bool isEnabled() { return m_state.enabled(); }
|
68
|
+
|
69
|
+
bool sentLogon() { return m_state.sentLogon(); }
|
70
|
+
bool sentLogout() { return m_state.sentLogout(); }
|
71
|
+
bool receivedLogon() { return m_state.receivedLogon(); }
|
72
|
+
bool isLoggedOn() { return receivedLogon() && sentLogon(); }
|
73
|
+
void reset() EXCEPT(IOException) {
|
74
|
+
generateLogout();
|
75
|
+
disconnect();
|
76
|
+
m_state.reset(m_timestamper());
|
77
|
+
}
|
78
|
+
void refresh() EXCEPT(IOException) { m_state.refresh(); }
|
79
|
+
void setNextSenderMsgSeqNum(SEQNUM num) EXCEPT(IOException) { m_state.setNextSenderMsgSeqNum(num); }
|
80
|
+
void setNextTargetMsgSeqNum(SEQNUM num) EXCEPT(IOException) { m_state.setNextTargetMsgSeqNum(num); }
|
81
|
+
|
82
|
+
const SessionID &getSessionID() const { return m_sessionID; }
|
83
|
+
void setDataDictionaryProvider(const DataDictionaryProvider &dataDictionaryProvider) {
|
84
|
+
m_dataDictionaryProvider = dataDictionaryProvider;
|
85
|
+
}
|
86
|
+
const DataDictionaryProvider &getDataDictionaryProvider() const { return m_dataDictionaryProvider; }
|
87
|
+
|
88
|
+
static bool sendToTarget(Message &message, const std::string &qualifier = "") EXCEPT(SessionNotFound);
|
89
|
+
static bool sendToTarget(Message &message, const SessionID &sessionID) EXCEPT(SessionNotFound);
|
90
|
+
static bool sendToTarget(
|
91
|
+
Message &,
|
92
|
+
const SenderCompID &senderCompID,
|
93
|
+
const TargetCompID &targetCompID,
|
94
|
+
const std::string &qualifier = "") EXCEPT(SessionNotFound);
|
95
|
+
static bool sendToTarget(
|
96
|
+
Message &message,
|
97
|
+
const std::string &senderCompID,
|
98
|
+
const std::string &targetCompID,
|
99
|
+
const std::string &qualifier = "") EXCEPT(SessionNotFound);
|
100
|
+
|
101
|
+
static std::set<SessionID> getSessions();
|
102
|
+
static bool doesSessionExist(const SessionID &);
|
103
|
+
static Session *lookupSession(const SessionID &);
|
104
|
+
static Session *lookupSession(const std::string &, bool reverse = false);
|
105
|
+
static bool isSessionRegistered(const SessionID &);
|
106
|
+
static Session *registerSession(const SessionID &);
|
107
|
+
static void unregisterSession(const SessionID &);
|
108
|
+
|
109
|
+
static size_t numSessions();
|
110
|
+
|
111
|
+
bool isSessionTime(const UtcTimeStamp &now) { return m_sessionTime.isInRange(now); }
|
112
|
+
bool isLogonTime(const UtcTimeStamp &now) { return m_logonTime.isInRange(now); }
|
113
|
+
bool isInitiator() { return m_state.initiate(); }
|
114
|
+
bool isAcceptor() { return !m_state.initiate(); }
|
115
|
+
|
116
|
+
const TimeRange &getLogonTime() { return m_logonTime; }
|
117
|
+
void setLogonTime(const TimeRange &value) { m_logonTime = value; }
|
118
|
+
|
119
|
+
const std::string &getSenderDefaultApplVerID() { return m_senderDefaultApplVerID; }
|
120
|
+
void setSenderDefaultApplVerID(const std::string &senderDefaultApplVerID) {
|
121
|
+
m_senderDefaultApplVerID = senderDefaultApplVerID;
|
122
|
+
}
|
123
|
+
|
124
|
+
const std::string &getTargetDefaultApplVerID() { return m_targetDefaultApplVerID; }
|
125
|
+
void setTargetDefaultApplVerID(const std::string &targetDefaultApplVerID) {
|
126
|
+
m_targetDefaultApplVerID = targetDefaultApplVerID;
|
127
|
+
}
|
128
|
+
|
129
|
+
bool getSendRedundantResendRequests() { return m_sendRedundantResendRequests; }
|
130
|
+
void setSendRedundantResendRequests(bool value) { m_sendRedundantResendRequests = value; }
|
131
|
+
|
132
|
+
bool getCheckCompId() { return m_checkCompId; }
|
133
|
+
void setCheckCompId(bool value) { m_checkCompId = value; }
|
134
|
+
|
135
|
+
bool getCheckLatency() { return m_checkLatency; }
|
136
|
+
void setCheckLatency(bool value) { m_checkLatency = value; }
|
137
|
+
|
138
|
+
int getMaxLatency() { return m_maxLatency; }
|
139
|
+
void setMaxLatency(int value) { m_maxLatency = value; }
|
140
|
+
|
141
|
+
int getLogonTimeout() { return m_state.logonTimeout(); }
|
142
|
+
void setLogonTimeout(int value) { m_state.logonTimeout(value); }
|
143
|
+
|
144
|
+
int getLogoutTimeout() { return m_state.logoutTimeout(); }
|
145
|
+
void setLogoutTimeout(int value) { m_state.logoutTimeout(value); }
|
146
|
+
|
147
|
+
bool getResetOnLogon() { return m_resetOnLogon; }
|
148
|
+
void setResetOnLogon(bool value) { m_resetOnLogon = value; }
|
149
|
+
|
150
|
+
bool getResetOnLogout() { return m_resetOnLogout; }
|
151
|
+
void setResetOnLogout(bool value) { m_resetOnLogout = value; }
|
152
|
+
|
153
|
+
bool getResetOnDisconnect() { return m_resetOnDisconnect; }
|
154
|
+
void setResetOnDisconnect(bool value) { m_resetOnDisconnect = value; }
|
155
|
+
|
156
|
+
bool getRefreshOnLogon() { return m_refreshOnLogon; }
|
157
|
+
void setRefreshOnLogon(bool value) { m_refreshOnLogon = value; }
|
158
|
+
|
159
|
+
bool getMillisecondsInTimeStamp() { return (m_timestampPrecision == 3); }
|
160
|
+
void setMillisecondsInTimeStamp(bool value) {
|
161
|
+
if (value) {
|
162
|
+
m_timestampPrecision = 3;
|
163
|
+
} else {
|
164
|
+
m_timestampPrecision = 0;
|
165
|
+
}
|
166
|
+
}
|
167
|
+
int getTimestampPrecision() { return m_timestampPrecision; }
|
168
|
+
void setTimestampPrecision(int precision) {
|
169
|
+
if (precision < 0 || precision > 9) {
|
170
|
+
return;
|
171
|
+
}
|
172
|
+
|
173
|
+
m_timestampPrecision = precision;
|
174
|
+
}
|
175
|
+
int getSupportedTimestampPrecision() {
|
176
|
+
return supportsSubSecondTimestamps(m_sessionID.getBeginString()) ? m_timestampPrecision : 0;
|
177
|
+
}
|
178
|
+
static bool supportsSubSecondTimestamps(const std::string &beginString) {
|
179
|
+
if (beginString == BeginString_FIXT11) {
|
180
|
+
return true;
|
181
|
+
} else {
|
182
|
+
return beginString >= BeginString_FIX42;
|
183
|
+
}
|
184
|
+
}
|
185
|
+
|
186
|
+
bool getPersistMessages() { return m_persistMessages; }
|
187
|
+
void setPersistMessages(bool value) { m_persistMessages = value; }
|
188
|
+
|
189
|
+
bool getValidateLengthAndChecksum() { return m_validateLengthAndChecksum; }
|
190
|
+
void setValidateLengthAndChecksum(bool value) { m_validateLengthAndChecksum = value; }
|
191
|
+
|
192
|
+
bool getSendNextExpectedMsgSeqNum() { return m_sendNextExpectedMsgSeqNum; }
|
193
|
+
void setSendNextExpectedMsgSeqNum(bool value) { m_sendNextExpectedMsgSeqNum = value; }
|
194
|
+
|
195
|
+
bool getIsNonStopSession() const { return m_isNonStopSession; }
|
196
|
+
void setIsNonStopSession(bool value) { m_isNonStopSession = value; }
|
197
|
+
|
198
|
+
const std::set<std::string> &getAllowedRemoteAddresses() const { return m_allowedRemoteAddresses; }
|
199
|
+
void setAllowedRemoteAddresses(const std::set<std::string> &value) { m_allowedRemoteAddresses = value; }
|
200
|
+
bool inAllowedRemoteAddresses(const std::string &value) const {
|
201
|
+
return (m_allowedRemoteAddresses.cend() != m_allowedRemoteAddresses.find(value));
|
202
|
+
}
|
203
|
+
|
204
|
+
void setResponder(Responder *pR) {
|
205
|
+
if (m_refreshOnLogon) {
|
206
|
+
refresh();
|
207
|
+
}
|
208
|
+
if (!checkSessionTime(m_timestamper())) {
|
209
|
+
reset();
|
210
|
+
}
|
211
|
+
m_pResponder = pR;
|
212
|
+
}
|
213
|
+
|
214
|
+
bool send(Message &);
|
215
|
+
void next(const UtcTimeStamp &now);
|
216
|
+
void next(const std::string &, const UtcTimeStamp &now, bool queued = false);
|
217
|
+
void next(const Message &, const UtcTimeStamp &now, bool queued = false);
|
218
|
+
void disconnect();
|
219
|
+
|
220
|
+
SEQNUM getExpectedSenderNum() { return m_state.getNextSenderMsgSeqNum(); }
|
221
|
+
SEQNUM getExpectedTargetNum() { return m_state.getNextTargetMsgSeqNum(); }
|
222
|
+
|
223
|
+
Log *getLog() { return &m_state; }
|
224
|
+
const MessageStore *getStore() { return &m_state; }
|
225
|
+
|
226
|
+
private:
|
227
|
+
typedef std::map<SessionID, Session *> Sessions;
|
228
|
+
typedef std::set<SessionID> SessionIDs;
|
229
|
+
|
230
|
+
static bool addSession(Session &);
|
231
|
+
static void removeSession(Session &);
|
232
|
+
|
233
|
+
bool send(const std::string &);
|
234
|
+
bool sendRaw(Message &, SEQNUM msgSeqNum = 0);
|
235
|
+
bool resend(Message &message);
|
236
|
+
void persist(const Message &, const std::string &) EXCEPT(IOException);
|
237
|
+
|
238
|
+
void insertSendingTime(Header &);
|
239
|
+
void insertOrigSendingTime(Header &, const UtcTimeStamp &now);
|
240
|
+
void fill(Header &);
|
241
|
+
|
242
|
+
bool isGoodTime(const SendingTime &sendingTime) {
|
243
|
+
if (!m_checkLatency) {
|
244
|
+
return true;
|
245
|
+
}
|
246
|
+
return labs(m_timestamper() - sendingTime) <= m_maxLatency;
|
247
|
+
}
|
248
|
+
bool checkSessionTime(const UtcTimeStamp &now) {
|
249
|
+
if (getIsNonStopSession()) {
|
250
|
+
return true;
|
251
|
+
}
|
252
|
+
UtcTimeStamp creationTime = m_state.getCreationTime();
|
253
|
+
return m_sessionTime.isInSameRange(now, creationTime);
|
254
|
+
}
|
255
|
+
bool isTargetTooHigh(const MsgSeqNum &msgSeqNum) { return msgSeqNum > (m_state.getNextTargetMsgSeqNum()); }
|
256
|
+
bool isTargetTooLow(const MsgSeqNum &msgSeqNum) { return msgSeqNum < (m_state.getNextTargetMsgSeqNum()); }
|
257
|
+
bool isCorrectCompID(const SenderCompID &senderCompID, const TargetCompID &targetCompID) {
|
258
|
+
if (!m_checkCompId) {
|
259
|
+
return true;
|
260
|
+
}
|
261
|
+
|
262
|
+
return m_sessionID.getSenderCompID().getValue() == targetCompID.getValue()
|
263
|
+
&& m_sessionID.getTargetCompID().getValue() == senderCompID.getValue();
|
264
|
+
}
|
265
|
+
bool shouldSendReset();
|
266
|
+
|
267
|
+
bool validLogonState(const MsgType &msgType);
|
268
|
+
void fromCallback(const MsgType &msgType, const Message &msg, const SessionID &sessionID);
|
269
|
+
|
270
|
+
void doBadTime(const Message &msg);
|
271
|
+
void doBadCompID(const Message &msg);
|
272
|
+
bool doPossDup(const Message &msg);
|
273
|
+
bool doTargetTooLow(const Message &msg);
|
274
|
+
void doTargetTooHigh(const Message &msg);
|
275
|
+
void nextQueued(const UtcTimeStamp &now);
|
276
|
+
bool nextQueued(SEQNUM num, const UtcTimeStamp &now);
|
277
|
+
|
278
|
+
void nextLogon(const Message &, const UtcTimeStamp &now);
|
279
|
+
void nextHeartbeat(const Message &, const UtcTimeStamp &now);
|
280
|
+
void nextTestRequest(const Message &, const UtcTimeStamp &now);
|
281
|
+
void nextLogout(const Message &, const UtcTimeStamp &now);
|
282
|
+
void nextReject(const Message &, const UtcTimeStamp &now);
|
283
|
+
void nextSequenceReset(const Message &, const UtcTimeStamp &now);
|
284
|
+
void nextResendRequest(const Message &, const UtcTimeStamp &now);
|
285
|
+
|
286
|
+
void generateLogon();
|
287
|
+
void generateLogon(const Message &);
|
288
|
+
void generateResendRequest(const BeginString &, const MsgSeqNum &);
|
289
|
+
void generateSequenceReset(SEQNUM, SEQNUM);
|
290
|
+
void generateRetransmits(SEQNUM beginSeqNo, SEQNUM endSeqNo);
|
291
|
+
void generateHeartbeat();
|
292
|
+
void generateHeartbeat(const Message &);
|
293
|
+
void generateTestRequest(const std::string &);
|
294
|
+
void generateReject(const Message &, int err, int field = 0);
|
295
|
+
void generateReject(const Message &, const std::string &text);
|
296
|
+
void generateBusinessReject(const Message &, int err, int field = 0);
|
297
|
+
void generateLogout(const std::string &text = "");
|
298
|
+
|
299
|
+
void populateRejectReason(Message &, int field, const std::string &text);
|
300
|
+
void populateRejectReason(Message &, const std::string &text);
|
301
|
+
|
302
|
+
bool verify(const Message &msg, bool checkTooHigh = true, bool checkTooLow = true);
|
303
|
+
|
304
|
+
Message newMessage(const MsgType &msgType) const;
|
305
|
+
|
306
|
+
std::function<UtcTimeStamp()> m_timestamper;
|
307
|
+
Application &m_application;
|
308
|
+
SessionID m_sessionID;
|
309
|
+
TimeRange m_sessionTime;
|
310
|
+
TimeRange m_logonTime;
|
311
|
+
|
312
|
+
std::string m_senderDefaultApplVerID;
|
313
|
+
std::string m_targetDefaultApplVerID;
|
314
|
+
bool m_sendRedundantResendRequests;
|
315
|
+
bool m_checkCompId;
|
316
|
+
bool m_checkLatency;
|
317
|
+
int m_maxLatency;
|
318
|
+
bool m_resetOnLogon;
|
319
|
+
bool m_resetOnLogout;
|
320
|
+
bool m_resetOnDisconnect;
|
321
|
+
bool m_refreshOnLogon;
|
322
|
+
int m_timestampPrecision;
|
323
|
+
bool m_persistMessages;
|
324
|
+
bool m_validateLengthAndChecksum;
|
325
|
+
bool m_sendNextExpectedMsgSeqNum;
|
326
|
+
bool m_isNonStopSession;
|
327
|
+
std::set<std::string> m_allowedRemoteAddresses;
|
328
|
+
|
329
|
+
SessionState m_state;
|
330
|
+
DataDictionaryProvider m_dataDictionaryProvider;
|
331
|
+
MessageStoreFactory &m_messageStoreFactory;
|
332
|
+
LogFactory *m_pLogFactory;
|
333
|
+
Responder *m_pResponder;
|
334
|
+
Mutex m_mutex;
|
335
|
+
|
336
|
+
static Sessions s_sessions;
|
337
|
+
static SessionIDs s_sessionIDs;
|
338
|
+
static Sessions s_registered;
|
339
|
+
static Mutex s_mutex;
|
340
|
+
};
|
341
|
+
} // namespace FIX
|
342
|
+
|
343
|
+
#endif // FIX_SESSION_H
|
@@ -0,0 +1,314 @@
|
|
1
|
+
/****************************************************************************
|
2
|
+
** Copyright (c) 2001-2014
|
3
|
+
**
|
4
|
+
** This file is part of the QuickFIX FIX Engine
|
5
|
+
**
|
6
|
+
** This file may be distributed under the terms of the quickfixengine.org
|
7
|
+
** license as defined by quickfixengine.org and appearing in the file
|
8
|
+
** LICENSE included in the packaging of this file.
|
9
|
+
**
|
10
|
+
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
11
|
+
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
12
|
+
**
|
13
|
+
** See http://www.quickfixengine.org/LICENSE for licensing information.
|
14
|
+
**
|
15
|
+
** Contact ask@quickfixengine.org if any conditions of this licensing are
|
16
|
+
** not clear to you.
|
17
|
+
**
|
18
|
+
****************************************************************************/
|
19
|
+
|
20
|
+
#ifdef _MSC_VER
|
21
|
+
#include "stdafx.h"
|
22
|
+
#else
|
23
|
+
#include "config.h"
|
24
|
+
#endif
|
25
|
+
|
26
|
+
#include "DataDictionaryProvider.h"
|
27
|
+
#include "Session.h"
|
28
|
+
#include "SessionFactory.h"
|
29
|
+
#include "SessionSettings.h"
|
30
|
+
#include "Utility.h"
|
31
|
+
#include "Values.h"
|
32
|
+
|
33
|
+
#include <memory>
|
34
|
+
|
35
|
+
namespace FIX {
|
36
|
+
SessionFactory::~SessionFactory() {}
|
37
|
+
|
38
|
+
Session *SessionFactory::create(const SessionID &sessionID, const Dictionary &settings) EXCEPT(ConfigError) {
|
39
|
+
std::string connectionType = settings.getString(CONNECTION_TYPE);
|
40
|
+
if (connectionType != "acceptor" && connectionType != "initiator") {
|
41
|
+
throw ConfigError("Invalid ConnectionType");
|
42
|
+
}
|
43
|
+
|
44
|
+
if (connectionType == "acceptor" && settings.has(SESSION_QUALIFIER)) {
|
45
|
+
throw ConfigError("SessionQualifier cannot be used with acceptor.");
|
46
|
+
}
|
47
|
+
|
48
|
+
bool useDataDictionary = true;
|
49
|
+
if (settings.has(USE_DATA_DICTIONARY)) {
|
50
|
+
useDataDictionary = settings.getBool(USE_DATA_DICTIONARY);
|
51
|
+
}
|
52
|
+
|
53
|
+
std::string defaultApplVerID;
|
54
|
+
if (sessionID.isFIXT()) {
|
55
|
+
if (!settings.has(DEFAULT_APPLVERID)) {
|
56
|
+
throw ConfigError("ApplVerID is required for FIXT transport");
|
57
|
+
}
|
58
|
+
defaultApplVerID = Message::toApplVerID(settings.getString(DEFAULT_APPLVERID));
|
59
|
+
}
|
60
|
+
|
61
|
+
DataDictionaryProvider dataDictionaryProvider;
|
62
|
+
if (useDataDictionary) {
|
63
|
+
if (sessionID.isFIXT()) {
|
64
|
+
processFixtDataDictionaries(sessionID, settings, dataDictionaryProvider);
|
65
|
+
} else {
|
66
|
+
processFixDataDictionary(sessionID, settings, dataDictionaryProvider);
|
67
|
+
}
|
68
|
+
}
|
69
|
+
|
70
|
+
bool useLocalTime = false;
|
71
|
+
if (settings.has(USE_LOCAL_TIME)) {
|
72
|
+
useLocalTime = settings.getBool(USE_LOCAL_TIME);
|
73
|
+
}
|
74
|
+
|
75
|
+
bool isNonStopSession = false;
|
76
|
+
if (settings.has(NON_STOP_SESSION)) {
|
77
|
+
isNonStopSession = settings.getBool(NON_STOP_SESSION);
|
78
|
+
}
|
79
|
+
|
80
|
+
int startDay = -1;
|
81
|
+
int endDay = -1;
|
82
|
+
try {
|
83
|
+
startDay = settings.getDay(START_DAY);
|
84
|
+
endDay = settings.getDay(END_DAY);
|
85
|
+
} catch (ConfigError &) {
|
86
|
+
} catch (FieldConvertError &e) {
|
87
|
+
throw ConfigError(e.what());
|
88
|
+
}
|
89
|
+
|
90
|
+
UtcTimeOnly startTime = UtcTimeOnly(0, 0, 0);
|
91
|
+
UtcTimeOnly endTime = UtcTimeOnly(0, 0, 0);
|
92
|
+
try {
|
93
|
+
startTime = UtcTimeOnlyConvertor::convert(settings.getString(START_TIME));
|
94
|
+
endTime = UtcTimeOnlyConvertor::convert(settings.getString(END_TIME));
|
95
|
+
} catch (ConfigError &e) {
|
96
|
+
if (!isNonStopSession) {
|
97
|
+
throw e;
|
98
|
+
}
|
99
|
+
} catch (FieldConvertError &e) {
|
100
|
+
throw ConfigError(e.what());
|
101
|
+
}
|
102
|
+
|
103
|
+
TimeRange utcSessionTime(startTime, endTime, startDay, endDay);
|
104
|
+
TimeRange localSessionTime(
|
105
|
+
LocalTimeOnly(startTime.getHour(), startTime.getMinute(), startTime.getSecond()),
|
106
|
+
LocalTimeOnly(endTime.getHour(), endTime.getMinute(), endTime.getSecond()),
|
107
|
+
startDay,
|
108
|
+
endDay);
|
109
|
+
TimeRange sessionTimeRange = useLocalTime ? localSessionTime : utcSessionTime;
|
110
|
+
|
111
|
+
if (startDay >= 0 && endDay < 0) {
|
112
|
+
throw ConfigError("StartDay used without EndDay");
|
113
|
+
}
|
114
|
+
if (endDay >= 0 && startDay < 0) {
|
115
|
+
throw ConfigError("EndDay used without StartDay");
|
116
|
+
}
|
117
|
+
|
118
|
+
if (isNonStopSession
|
119
|
+
&& (startDay >= 0 || endDay >= 0 || startTime != UtcTimeOnly(0, 0, 0) || endTime != UtcTimeOnly(0, 0, 0))) {
|
120
|
+
throw ConfigError("NonStopSession used with StartTime/EndTime/StartDay/EndDay");
|
121
|
+
}
|
122
|
+
|
123
|
+
HeartBtInt heartBtInt(0);
|
124
|
+
if (connectionType == "initiator") {
|
125
|
+
heartBtInt = HeartBtInt(settings.getInt(HEARTBTINT));
|
126
|
+
if (heartBtInt <= 0) {
|
127
|
+
throw ConfigError("Heartbeat must be greater than zero");
|
128
|
+
}
|
129
|
+
}
|
130
|
+
|
131
|
+
std::unique_ptr<Session> pSession;
|
132
|
+
pSession.reset(new Session(
|
133
|
+
[]() { return UtcTimeStamp::now(); },
|
134
|
+
m_application,
|
135
|
+
m_messageStoreFactory,
|
136
|
+
sessionID,
|
137
|
+
dataDictionaryProvider,
|
138
|
+
sessionTimeRange,
|
139
|
+
heartBtInt,
|
140
|
+
m_pLogFactory));
|
141
|
+
|
142
|
+
pSession->setSenderDefaultApplVerID(defaultApplVerID);
|
143
|
+
|
144
|
+
int logonDay = startDay;
|
145
|
+
int logoutDay = endDay;
|
146
|
+
try {
|
147
|
+
logonDay = settings.getDay(LOGON_DAY);
|
148
|
+
logoutDay = settings.getDay(LOGOUT_DAY);
|
149
|
+
} catch (ConfigError &) {
|
150
|
+
} catch (FieldConvertError &e) {
|
151
|
+
throw ConfigError(e.what());
|
152
|
+
}
|
153
|
+
|
154
|
+
UtcTimeOnly logonTime(startTime);
|
155
|
+
UtcTimeOnly logoutTime(endTime);
|
156
|
+
try {
|
157
|
+
logonTime = UtcTimeOnlyConvertor::convert(settings.getString(LOGON_TIME));
|
158
|
+
} catch (ConfigError &) {
|
159
|
+
} catch (FieldConvertError &e) {
|
160
|
+
throw ConfigError(e.what());
|
161
|
+
}
|
162
|
+
|
163
|
+
try {
|
164
|
+
logoutTime = UtcTimeOnlyConvertor::convert(settings.getString(LOGOUT_TIME));
|
165
|
+
} catch (ConfigError &) {
|
166
|
+
} catch (FieldConvertError &e) {
|
167
|
+
throw ConfigError(e.what());
|
168
|
+
}
|
169
|
+
|
170
|
+
TimeRange utcLogonTime(logonTime, logoutTime, logonDay, logoutDay);
|
171
|
+
TimeRange localLogonTime(
|
172
|
+
LocalTimeOnly(logonTime.getHour(), logonTime.getMinute(), logonTime.getSecond()),
|
173
|
+
LocalTimeOnly(logoutTime.getHour(), logoutTime.getMinute(), logoutTime.getSecond()),
|
174
|
+
logonDay,
|
175
|
+
logoutDay);
|
176
|
+
TimeRange logonTimeRange = useLocalTime ? localLogonTime : utcLogonTime;
|
177
|
+
|
178
|
+
if (!sessionTimeRange.isInRange(logonTime, logonDay)) {
|
179
|
+
throw ConfigError("LogonTime must be between StartTime and EndTime");
|
180
|
+
}
|
181
|
+
if (!sessionTimeRange.isInRange(logoutTime, logoutDay)) {
|
182
|
+
throw ConfigError("LogoutTime must be between StartTime and EndTime");
|
183
|
+
}
|
184
|
+
pSession->setLogonTime(logonTimeRange);
|
185
|
+
|
186
|
+
if (settings.has(SEND_REDUNDANT_RESENDREQUESTS)) {
|
187
|
+
pSession->setSendRedundantResendRequests(settings.getBool(SEND_REDUNDANT_RESENDREQUESTS));
|
188
|
+
}
|
189
|
+
if (settings.has(CHECK_COMPID)) {
|
190
|
+
pSession->setCheckCompId(settings.getBool(CHECK_COMPID));
|
191
|
+
}
|
192
|
+
if (settings.has(CHECK_LATENCY)) {
|
193
|
+
pSession->setCheckLatency(settings.getBool(CHECK_LATENCY));
|
194
|
+
}
|
195
|
+
if (settings.has(MAX_LATENCY)) {
|
196
|
+
pSession->setMaxLatency(settings.getInt(MAX_LATENCY));
|
197
|
+
}
|
198
|
+
if (settings.has(LOGON_TIMEOUT)) {
|
199
|
+
pSession->setLogonTimeout(settings.getInt(LOGON_TIMEOUT));
|
200
|
+
}
|
201
|
+
if (settings.has(LOGOUT_TIMEOUT)) {
|
202
|
+
pSession->setLogoutTimeout(settings.getInt(LOGOUT_TIMEOUT));
|
203
|
+
}
|
204
|
+
if (settings.has(RESET_ON_LOGON)) {
|
205
|
+
pSession->setResetOnLogon(settings.getBool(RESET_ON_LOGON));
|
206
|
+
}
|
207
|
+
if (settings.has(RESET_ON_LOGOUT)) {
|
208
|
+
pSession->setResetOnLogout(settings.getBool(RESET_ON_LOGOUT));
|
209
|
+
}
|
210
|
+
if (settings.has(RESET_ON_DISCONNECT)) {
|
211
|
+
pSession->setResetOnDisconnect(settings.getBool(RESET_ON_DISCONNECT));
|
212
|
+
}
|
213
|
+
if (settings.has(REFRESH_ON_LOGON)) {
|
214
|
+
pSession->setRefreshOnLogon(settings.getBool(REFRESH_ON_LOGON));
|
215
|
+
}
|
216
|
+
if (settings.has(MILLISECONDS_IN_TIMESTAMP)) {
|
217
|
+
pSession->setMillisecondsInTimeStamp(settings.getBool(MILLISECONDS_IN_TIMESTAMP));
|
218
|
+
}
|
219
|
+
if (settings.has(PERSIST_MESSAGES)) {
|
220
|
+
pSession->setPersistMessages(settings.getBool(PERSIST_MESSAGES));
|
221
|
+
}
|
222
|
+
if (settings.has(VALIDATE_LENGTH_AND_CHECKSUM)) {
|
223
|
+
pSession->setValidateLengthAndChecksum(settings.getBool(VALIDATE_LENGTH_AND_CHECKSUM));
|
224
|
+
}
|
225
|
+
if (settings.has(SEND_NEXT_EXPECTED_MSG_SEQ_NUM)) {
|
226
|
+
pSession->setSendNextExpectedMsgSeqNum(settings.getBool(SEND_NEXT_EXPECTED_MSG_SEQ_NUM));
|
227
|
+
}
|
228
|
+
if (isNonStopSession) {
|
229
|
+
pSession->setIsNonStopSession(isNonStopSession);
|
230
|
+
}
|
231
|
+
if (settings.has(ALLOWED_REMOTE_ADDRESSES)) {
|
232
|
+
pSession->setAllowedRemoteAddresses(string_split(settings.getString(ALLOWED_REMOTE_ADDRESSES), ','));
|
233
|
+
}
|
234
|
+
|
235
|
+
return pSession.release();
|
236
|
+
}
|
237
|
+
|
238
|
+
void SessionFactory::destroy(Session *pSession) { delete pSession; }
|
239
|
+
|
240
|
+
std::shared_ptr<DataDictionary> SessionFactory::createDataDictionary(
|
241
|
+
const SessionID &sessionID,
|
242
|
+
const Dictionary &settings,
|
243
|
+
const std::string &settingsKey) EXCEPT(ConfigError) {
|
244
|
+
std::shared_ptr<DataDictionary> pDD;
|
245
|
+
std::string path = settings.getString(settingsKey);
|
246
|
+
Dictionaries::iterator i = m_dictionaries.find(path);
|
247
|
+
if (i != m_dictionaries.end()) {
|
248
|
+
pDD = i->second;
|
249
|
+
} else {
|
250
|
+
bool preserveMsgFldsOrder = false;
|
251
|
+
if (settings.has(PRESERVE_MESSAGE_FIELDS_ORDER)) {
|
252
|
+
preserveMsgFldsOrder = settings.getBool(PRESERVE_MESSAGE_FIELDS_ORDER);
|
253
|
+
}
|
254
|
+
pDD = std::shared_ptr<DataDictionary>(new DataDictionary(path, preserveMsgFldsOrder));
|
255
|
+
m_dictionaries[path] = pDD;
|
256
|
+
}
|
257
|
+
|
258
|
+
std::shared_ptr<DataDictionary> pCopyOfDD = std::shared_ptr<DataDictionary>(new DataDictionary(*pDD));
|
259
|
+
|
260
|
+
if (settings.has(VALIDATE_FIELDS_OUT_OF_ORDER)) {
|
261
|
+
pCopyOfDD->checkFieldsOutOfOrder(settings.getBool(VALIDATE_FIELDS_OUT_OF_ORDER));
|
262
|
+
}
|
263
|
+
if (settings.has(VALIDATE_FIELDS_HAVE_VALUES)) {
|
264
|
+
pCopyOfDD->checkFieldsHaveValues(settings.getBool(VALIDATE_FIELDS_HAVE_VALUES));
|
265
|
+
}
|
266
|
+
if (settings.has(VALIDATE_USER_DEFINED_FIELDS)) {
|
267
|
+
pCopyOfDD->checkUserDefinedFields(settings.getBool(VALIDATE_USER_DEFINED_FIELDS));
|
268
|
+
}
|
269
|
+
if (settings.has(ALLOW_UNKNOWN_MSG_FIELDS)) {
|
270
|
+
pCopyOfDD->allowUnknownMsgFields(settings.getBool(ALLOW_UNKNOWN_MSG_FIELDS));
|
271
|
+
}
|
272
|
+
|
273
|
+
return pCopyOfDD;
|
274
|
+
}
|
275
|
+
|
276
|
+
void SessionFactory::processFixtDataDictionaries(
|
277
|
+
const SessionID &sessionID,
|
278
|
+
const Dictionary &settings,
|
279
|
+
DataDictionaryProvider &provider) EXCEPT(ConfigError) {
|
280
|
+
std::shared_ptr<DataDictionary> pDataDictionary
|
281
|
+
= createDataDictionary(sessionID, settings, TRANSPORT_DATA_DICTIONARY);
|
282
|
+
provider.addTransportDataDictionary(sessionID.getBeginString(), pDataDictionary);
|
283
|
+
|
284
|
+
for (const Dictionary::value_type &data : settings) {
|
285
|
+
const std::string &key = data.first;
|
286
|
+
const std::string frontKey = key.substr(0, strlen(APP_DATA_DICTIONARY));
|
287
|
+
if (frontKey == string_toUpper(APP_DATA_DICTIONARY)) {
|
288
|
+
if (key == string_toUpper(APP_DATA_DICTIONARY)) {
|
289
|
+
provider.addApplicationDataDictionary(
|
290
|
+
Message::toApplVerID(settings.getString(DEFAULT_APPLVERID)),
|
291
|
+
createDataDictionary(sessionID, settings, APP_DATA_DICTIONARY));
|
292
|
+
} else {
|
293
|
+
std::string::size_type offset = key.find('.');
|
294
|
+
if (offset == std::string::npos) {
|
295
|
+
throw ConfigError(std::string("Malformed ") + APP_DATA_DICTIONARY + ": " + key);
|
296
|
+
}
|
297
|
+
std::string beginStringQualifier = key.substr(offset + 1);
|
298
|
+
provider.addApplicationDataDictionary(
|
299
|
+
Message::toApplVerID(beginStringQualifier),
|
300
|
+
createDataDictionary(sessionID, settings, key));
|
301
|
+
}
|
302
|
+
}
|
303
|
+
}
|
304
|
+
}
|
305
|
+
|
306
|
+
void SessionFactory::processFixDataDictionary(
|
307
|
+
const SessionID &sessionID,
|
308
|
+
const Dictionary &settings,
|
309
|
+
DataDictionaryProvider &provider) EXCEPT(ConfigError) {
|
310
|
+
std::shared_ptr<DataDictionary> pDataDictionary = createDataDictionary(sessionID, settings, DATA_DICTIONARY);
|
311
|
+
provider.addTransportDataDictionary(sessionID.getBeginString(), pDataDictionary);
|
312
|
+
provider.addApplicationDataDictionary(Message::toApplVerID(sessionID.getBeginString()), pDataDictionary);
|
313
|
+
}
|
314
|
+
} // namespace FIX
|