quickfix_ruby 1.14.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (149) hide show
  1. checksums.yaml +7 -0
  2. data/ext/quickfix/Acceptor.cpp +248 -0
  3. data/ext/quickfix/Acceptor.h +127 -0
  4. data/ext/quickfix/Allocator.h +9 -0
  5. data/ext/quickfix/Application.h +127 -0
  6. data/ext/quickfix/AtomicCount.h +109 -0
  7. data/ext/quickfix/DOMDocument.h +74 -0
  8. data/ext/quickfix/DataDictionary.cpp +618 -0
  9. data/ext/quickfix/DataDictionary.h +539 -0
  10. data/ext/quickfix/DataDictionaryProvider.cpp +71 -0
  11. data/ext/quickfix/DataDictionaryProvider.h +70 -0
  12. data/ext/quickfix/DatabaseConnectionID.h +105 -0
  13. data/ext/quickfix/DatabaseConnectionPool.h +91 -0
  14. data/ext/quickfix/Dictionary.cpp +162 -0
  15. data/ext/quickfix/Dictionary.h +94 -0
  16. data/ext/quickfix/Event.h +95 -0
  17. data/ext/quickfix/Exceptions.h +299 -0
  18. data/ext/quickfix/Field.h +672 -0
  19. data/ext/quickfix/FieldConvertors.h +863 -0
  20. data/ext/quickfix/FieldMap.cpp +238 -0
  21. data/ext/quickfix/FieldMap.h +244 -0
  22. data/ext/quickfix/FieldNumbers.h +46 -0
  23. data/ext/quickfix/FieldTypes.cpp +64 -0
  24. data/ext/quickfix/FieldTypes.h +698 -0
  25. data/ext/quickfix/Fields.h +31 -0
  26. data/ext/quickfix/FileLog.cpp +200 -0
  27. data/ext/quickfix/FileLog.h +112 -0
  28. data/ext/quickfix/FileStore.cpp +332 -0
  29. data/ext/quickfix/FileStore.h +129 -0
  30. data/ext/quickfix/FixFieldNumbers.h +1537 -0
  31. data/ext/quickfix/FixFields.h +1538 -0
  32. data/ext/quickfix/FixValues.h +3281 -0
  33. data/ext/quickfix/FlexLexer.h +188 -0
  34. data/ext/quickfix/Group.cpp +64 -0
  35. data/ext/quickfix/Group.h +73 -0
  36. data/ext/quickfix/HtmlBuilder.h +186 -0
  37. data/ext/quickfix/HttpConnection.cpp +739 -0
  38. data/ext/quickfix/HttpConnection.h +78 -0
  39. data/ext/quickfix/HttpMessage.cpp +149 -0
  40. data/ext/quickfix/HttpMessage.h +133 -0
  41. data/ext/quickfix/HttpParser.cpp +49 -0
  42. data/ext/quickfix/HttpParser.h +54 -0
  43. data/ext/quickfix/HttpServer.cpp +169 -0
  44. data/ext/quickfix/HttpServer.h +78 -0
  45. data/ext/quickfix/Initiator.cpp +289 -0
  46. data/ext/quickfix/Initiator.h +149 -0
  47. data/ext/quickfix/Log.cpp +77 -0
  48. data/ext/quickfix/Log.h +179 -0
  49. data/ext/quickfix/Message.cpp +580 -0
  50. data/ext/quickfix/Message.h +370 -0
  51. data/ext/quickfix/MessageCracker.h +188 -0
  52. data/ext/quickfix/MessageSorters.cpp +105 -0
  53. data/ext/quickfix/MessageSorters.h +156 -0
  54. data/ext/quickfix/MessageStore.cpp +146 -0
  55. data/ext/quickfix/MessageStore.h +174 -0
  56. data/ext/quickfix/Mutex.h +131 -0
  57. data/ext/quickfix/MySQLConnection.h +194 -0
  58. data/ext/quickfix/MySQLLog.cpp +275 -0
  59. data/ext/quickfix/MySQLLog.h +145 -0
  60. data/ext/quickfix/MySQLStore.cpp +331 -0
  61. data/ext/quickfix/MySQLStore.h +142 -0
  62. data/ext/quickfix/NullStore.cpp +54 -0
  63. data/ext/quickfix/NullStore.h +99 -0
  64. data/ext/quickfix/OdbcConnection.h +266 -0
  65. data/ext/quickfix/OdbcLog.cpp +252 -0
  66. data/ext/quickfix/OdbcLog.h +117 -0
  67. data/ext/quickfix/OdbcStore.cpp +338 -0
  68. data/ext/quickfix/OdbcStore.h +113 -0
  69. data/ext/quickfix/PUGIXML_DOMDocument.cpp +112 -0
  70. data/ext/quickfix/PUGIXML_DOMDocument.h +81 -0
  71. data/ext/quickfix/Parser.cpp +103 -0
  72. data/ext/quickfix/Parser.h +57 -0
  73. data/ext/quickfix/PostgreSQLConnection.h +176 -0
  74. data/ext/quickfix/PostgreSQLLog.cpp +276 -0
  75. data/ext/quickfix/PostgreSQLLog.h +144 -0
  76. data/ext/quickfix/PostgreSQLStore.cpp +334 -0
  77. data/ext/quickfix/PostgreSQLStore.h +141 -0
  78. data/ext/quickfix/Queue.h +75 -0
  79. data/ext/quickfix/QuickfixRuby.cpp +252066 -0
  80. data/ext/quickfix/QuickfixRuby.h +34 -0
  81. data/ext/quickfix/Responder.h +43 -0
  82. data/ext/quickfix/Session.cpp +1487 -0
  83. data/ext/quickfix/Session.h +335 -0
  84. data/ext/quickfix/SessionFactory.cpp +274 -0
  85. data/ext/quickfix/SessionFactory.h +86 -0
  86. data/ext/quickfix/SessionID.h +170 -0
  87. data/ext/quickfix/SessionSettings.cpp +189 -0
  88. data/ext/quickfix/SessionSettings.h +171 -0
  89. data/ext/quickfix/SessionState.h +231 -0
  90. data/ext/quickfix/Settings.cpp +100 -0
  91. data/ext/quickfix/Settings.h +53 -0
  92. data/ext/quickfix/SharedArray.h +150 -0
  93. data/ext/quickfix/SocketAcceptor.cpp +222 -0
  94. data/ext/quickfix/SocketAcceptor.h +75 -0
  95. data/ext/quickfix/SocketConnection.cpp +238 -0
  96. data/ext/quickfix/SocketConnection.h +103 -0
  97. data/ext/quickfix/SocketConnector.cpp +116 -0
  98. data/ext/quickfix/SocketConnector.h +67 -0
  99. data/ext/quickfix/SocketInitiator.cpp +260 -0
  100. data/ext/quickfix/SocketInitiator.h +81 -0
  101. data/ext/quickfix/SocketMonitor.cpp +335 -0
  102. data/ext/quickfix/SocketMonitor.h +111 -0
  103. data/ext/quickfix/SocketServer.cpp +177 -0
  104. data/ext/quickfix/SocketServer.h +100 -0
  105. data/ext/quickfix/ThreadedSocketAcceptor.cpp +258 -0
  106. data/ext/quickfix/ThreadedSocketAcceptor.h +98 -0
  107. data/ext/quickfix/ThreadedSocketConnection.cpp +209 -0
  108. data/ext/quickfix/ThreadedSocketConnection.h +82 -0
  109. data/ext/quickfix/ThreadedSocketInitiator.cpp +268 -0
  110. data/ext/quickfix/ThreadedSocketInitiator.h +84 -0
  111. data/ext/quickfix/TimeRange.cpp +173 -0
  112. data/ext/quickfix/TimeRange.h +258 -0
  113. data/ext/quickfix/Utility.cpp +537 -0
  114. data/ext/quickfix/Utility.h +219 -0
  115. data/ext/quickfix/Values.h +62 -0
  116. data/ext/quickfix/config.h +0 -0
  117. data/ext/quickfix/config_windows.h +0 -0
  118. data/ext/quickfix/extconf.rb +12 -0
  119. data/ext/quickfix/index.h +37 -0
  120. data/ext/quickfix/pugiconfig.hpp +72 -0
  121. data/ext/quickfix/pugixml.cpp +10765 -0
  122. data/ext/quickfix/pugixml.hpp +1341 -0
  123. data/ext/quickfix/strptime.h +7 -0
  124. data/lib/quickfix40.rb +274 -0
  125. data/lib/quickfix41.rb +351 -0
  126. data/lib/quickfix42.rb +1184 -0
  127. data/lib/quickfix43.rb +3504 -0
  128. data/lib/quickfix44.rb +10721 -0
  129. data/lib/quickfix50.rb +13426 -0
  130. data/lib/quickfix50sp1.rb +15629 -0
  131. data/lib/quickfix50sp2.rb +17068 -0
  132. data/lib/quickfix_fields.rb +19853 -0
  133. data/lib/quickfix_ruby.rb +82 -0
  134. data/lib/quickfixt11.rb +70 -0
  135. data/spec/FIX40.xml +862 -0
  136. data/spec/FIX41.xml +1285 -0
  137. data/spec/FIX42.xml +2746 -0
  138. data/spec/FIX43.xml +4229 -0
  139. data/spec/FIX44.xml +6596 -0
  140. data/spec/FIX50.xml +8137 -0
  141. data/spec/FIX50SP1.xml +9496 -0
  142. data/spec/FIX50SP2.xml +10011 -0
  143. data/spec/FIXT11.xml +313 -0
  144. data/test/test_DataDictionaryTestCase.rb +268 -0
  145. data/test/test_DictionaryTestCase.rb +112 -0
  146. data/test/test_FieldBaseTestCase.rb +24 -0
  147. data/test/test_MessageTestCase.rb +368 -0
  148. data/test/test_SessionSettingsTestCase.rb +41 -0
  149. metadata +193 -0
@@ -0,0 +1,299 @@
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_EXCEPTIONS_H
23
+ #define FIX_EXCEPTIONS_H
24
+
25
+ #include <string>
26
+ #include <stdexcept>
27
+ #include "Utility.h"
28
+
29
+ namespace FIX
30
+ {
31
+
32
+ /// Base QuickFIX exception type.
33
+ struct Exception : public std::logic_error
34
+ {
35
+ Exception( const std::string& t, const std::string& d )
36
+ : std::logic_error( d.size() ? t + ": " + d : t ),
37
+ type( t ), detail( d )
38
+ {}
39
+ ~Exception() throw() {}
40
+
41
+ std::string type;
42
+ std::string detail;
43
+ };
44
+
45
+ /// DataDictionary not found for BeginString or ApplVerID
46
+ struct DataDictionaryNotFound : public Exception
47
+ {
48
+ DataDictionaryNotFound( const std::string& v, const std::string& what = "" )
49
+ : Exception( "Could not find data dictionary", what ),
50
+ version( v ) {}
51
+ ~DataDictionaryNotFound() throw() {}
52
+
53
+ std::string version;
54
+ };
55
+
56
+ /// Field not found inside a message
57
+ struct FieldNotFound : public Exception
58
+ {
59
+ FieldNotFound( int f = 0, const std::string& what = "" )
60
+ : Exception( "Field not found", what ),
61
+ field( f ) {}
62
+ int field;
63
+ };
64
+
65
+ /// Unable to convert field into its native format
66
+ struct FieldConvertError : public Exception
67
+ {
68
+ FieldConvertError( const std::string& what = "" )
69
+ : Exception( "Could not convert field", what ) {}
70
+ };
71
+
72
+ /// Unable to parse message
73
+ struct MessageParseError : public Exception
74
+ {
75
+ MessageParseError( const std::string& what = "" )
76
+ : Exception( "Could not parse message", what ) {}
77
+ };
78
+
79
+ /// Not a recognizable message
80
+ struct InvalidMessage : public Exception
81
+ {
82
+ InvalidMessage( const std::string& what = "" )
83
+ : Exception( "Invalid message", what ) {}
84
+ };
85
+
86
+ /// %Application is not configured correctly
87
+ struct ConfigError : public Exception
88
+ {
89
+ ConfigError( const std::string& what = "" )
90
+ : Exception( "Configuration failed", what ) {}
91
+ };
92
+
93
+ /// %Application encountered serious error during runtime
94
+ struct RuntimeError : public Exception
95
+ {
96
+ RuntimeError( const std::string& what = "" )
97
+ : Exception( "Runtime error", what ) {}
98
+ };
99
+
100
+ /// Tag number does not exist in specification
101
+ struct InvalidTagNumber : public Exception
102
+ {
103
+ InvalidTagNumber( int f = 0, const std::string& what = "" )
104
+ : Exception( "Invalid tag number", what ),
105
+ field( f ) {}
106
+ int field;
107
+ };
108
+
109
+ /// Required field is not in message
110
+ struct RequiredTagMissing : public Exception
111
+ {
112
+ RequiredTagMissing( int f = 0, const std::string& what = "" )
113
+ : Exception( "Required tag missing", what ),
114
+ field( f ) {}
115
+ int field;
116
+ };
117
+
118
+ /// Field does not belong to message
119
+ struct TagNotDefinedForMessage : public Exception
120
+ {
121
+ TagNotDefinedForMessage( int f = 0, const std::string& what = "" )
122
+ : Exception( "Tag not defined for this message type", what ),
123
+ field( f ) {}
124
+ int field;
125
+ };
126
+
127
+ /// Field exists in message without a value
128
+ struct NoTagValue : public Exception
129
+ {
130
+ NoTagValue( int f = 0, const std::string& what = "" )
131
+ : Exception( "Tag specified without a value", what ),
132
+ field( f ) {}
133
+ int field;
134
+ };
135
+
136
+ /// Field has a value that is out of range
137
+ struct IncorrectTagValue : public Exception
138
+ {
139
+ IncorrectTagValue( int f = 0, const std::string& what = "" )
140
+ : Exception( "Value is incorrect (out of range) for this tag", what ),
141
+ field( f ) {}
142
+ int field;
143
+ };
144
+
145
+ /// Field has a badly formatted value
146
+ struct IncorrectDataFormat : public Exception
147
+ {
148
+ IncorrectDataFormat( int f = 0, const std::string& what = "" )
149
+ : Exception( "Incorrect data format for value", what ),
150
+ field( f ) {}
151
+ int field;
152
+ };
153
+
154
+ /// Message is not structured correctly
155
+ struct IncorrectMessageStructure : public Exception
156
+ {
157
+ IncorrectMessageStructure( const std::string& what = "" )
158
+ : Exception( "Incorrect message structure", what ) {}
159
+ };
160
+
161
+ /// Field shows up twice in the message
162
+ struct DuplicateFieldNumber : public Exception
163
+ {
164
+ DuplicateFieldNumber( const std::string& what = "" )
165
+ : Exception( "Duplicate field number", what ) {}
166
+ };
167
+
168
+ /// Not a known message type
169
+ struct InvalidMessageType : public Exception
170
+ {
171
+ InvalidMessageType( const std::string& what = "" )
172
+ : Exception( "Invalid Message Type", what ) {}
173
+ };
174
+
175
+ /// Message type not supported by application
176
+ struct UnsupportedMessageType : public Exception
177
+ {
178
+ UnsupportedMessageType( const std::string& what = "" )
179
+ : Exception( "Unsupported Message Type", what ) {}
180
+ };
181
+
182
+ /// Version of %FIX is not supported
183
+ struct UnsupportedVersion : public Exception
184
+ {
185
+ UnsupportedVersion( const std::string& what = "" )
186
+ : Exception( "Unsupported Version", what ) {}
187
+ };
188
+
189
+ /// Tag is not in the correct order
190
+ struct TagOutOfOrder : public Exception
191
+ {
192
+ TagOutOfOrder( int f = 0, const std::string& what = "" )
193
+ : Exception( "Tag specified out of required order", what ),
194
+ field( f ) {}
195
+ int field;
196
+ };
197
+
198
+ /// Repeated tag not part of repeating group
199
+ struct RepeatedTag : public Exception
200
+ {
201
+ RepeatedTag( int f = 0, const std::string& what = "" )
202
+ : Exception( "Repeated tag not part of repeating group", what ),
203
+ field( f ) {}
204
+ int field;
205
+ };
206
+
207
+ /// Repeated group count not equal to actual count
208
+ struct RepeatingGroupCountMismatch : public Exception
209
+ {
210
+ RepeatingGroupCountMismatch( int f = 0, const std::string& what = "" )
211
+ : Exception( "Repeating group count mismatch", what ),
212
+ field( f ) {}
213
+ int field;
214
+ };
215
+
216
+ /// Indicates user does not want to send a message
217
+ struct DoNotSend : public Exception
218
+ {
219
+ DoNotSend( const std::string& what = "" )
220
+ : Exception( "Do Not Send Message", what ) {}
221
+ };
222
+
223
+ /// User wants to reject permission to logon
224
+ struct RejectLogon : public Exception
225
+ {
226
+ RejectLogon( const std::string& what = "" )
227
+ : Exception( "Rejected Logon Attempt", what ) {}
228
+ };
229
+
230
+ /// Session cannot be found for specified action
231
+ struct SessionNotFound : public Exception
232
+ {
233
+ SessionNotFound( const std::string& what = "" )
234
+ : Exception( "Session Not Found", what ) {}
235
+ };
236
+
237
+ /// IO Error
238
+ struct IOException : public Exception
239
+ {
240
+ IOException( const std::string& what = "" )
241
+ : Exception( "IO Error", what ) {}
242
+ };
243
+
244
+ /// Socket Error
245
+ struct SocketException : public Exception
246
+ {
247
+ SocketException()
248
+ : Exception( "Socket Error", errorToWhat() ) {}
249
+
250
+ SocketException( const std::string& what )
251
+ : Exception( "Socket Error", what ) {}
252
+
253
+ std::string errorToWhat()
254
+ {
255
+ #ifdef _MSC_VER
256
+ error = WSAGetLastError();
257
+ char buffer[2048];
258
+ FormatMessageA( FORMAT_MESSAGE_FROM_SYSTEM, NULL, error,
259
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
260
+ buffer, 2048, NULL );
261
+ return buffer;
262
+ #else
263
+ error = errno;
264
+ return strerror( error );
265
+ #endif
266
+ }
267
+
268
+ int error;
269
+ };
270
+
271
+ /// Socket send operation failed
272
+ struct SocketSendFailed : public SocketException
273
+ {
274
+ SocketSendFailed() {}
275
+ SocketSendFailed( const std::string& what )
276
+ : SocketException( what ) {}
277
+ };
278
+
279
+ /// Socket recv operation failed
280
+ struct SocketRecvFailed : public SocketException
281
+ {
282
+ SocketRecvFailed( ssize_t size )
283
+ : SocketException( size == 0 ? "Connection reset by peer." : size < 0 ? errorToWhat() : "Success." ) {}
284
+ SocketRecvFailed( const std::string& what )
285
+ : SocketException( what ) {}
286
+ };
287
+
288
+ /// Socket close operation failed
289
+ struct SocketCloseFailed : public SocketException
290
+ {
291
+ SocketCloseFailed() {}
292
+ SocketCloseFailed( const std::string& what )
293
+ : SocketException( what ) {}
294
+ };
295
+
296
+ /*! @} */
297
+ }
298
+
299
+ #endif //FIX_EXCEPTIONS_H