OnixS C++ FIX Engine 4.13.0
API Documentation
Loading...
Searching...
No Matches
ISessionListener.h
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
20#pragma once
21
22#include <string>
23
28
29namespace OnixS {
30namespace FIX {
34
64
87
91{
92public:
93
94 enum Source
95 {
98
101
104 };
105
106 ReceivedDataTimestamp():timestamp_(), source_(Source::None) { }
107
109
111 const Timestamp & timestamp() const
112 {
113 return timestamp_;
114 }
115
118 {
119 return source_;
120 }
121
123 std::string toString() const
124 {
125 const std::string TimeStr = timestamp_.toString();
126 std::string str = "ReceivedDataTimestamp [source = ";
127
128 if(source_ == ReceivedDataTimestamp::None)
129 str += "None";
130 else if(source_ == ReceivedDataTimestamp::Software)
131 str += "Software, time = " + TimeStr;
132 else if (source_ == ReceivedDataTimestamp::Hardware)
133 str += "Hardware, time = " + TimeStr;
134 else
135 str += "Unknown";
136
137 str += "]";
138 return str;
139 }
140
141private:
142
144 Timestamp timestamp_;
145 Source source_;
146};
147
150{
151public:
154
158 virtual void onInboundApplicationMsg(Message & message, Session * session) = 0;
159
164
167 virtual void onInboundSessionMsg(Message & /*message*/, Session * /*session*/) {}
168
171 virtual void onInboundSessionMsg(FlatMessage & /*message*/, Session * /*session*/) {}
172
179 virtual void onOutboundApplicationMsg(Message & /*message*/, Session * /*session*/) {}
180
187 virtual void onOutboundSessionMsg(Message & /*message*/, Session * /*session*/) {}
188
190 virtual void onReceivedBytes(const char * /*bytes*/, size_t /*size*/, const ReceivedDataTimestamp & /*timestamp*/, Session* /*session*/) {}
191
195 virtual void onMessageSending(SequenceNumber /*msgSeqNum*/, char * /*bytes*/, size_t /*size*/, Session * /*session*/) {}
196
198 virtual void onStateChange(SessionState::Enum /*newState*/, SessionState::Enum /*prevState*/, Session * /*session*/) {}
199
204 virtual bool onResendRequest(Message & /*message*/, Session * /*session*/) { return false; }
205
210 virtual bool onResendRequest(FlatMessage & /*message*/, Session * /*session*/) { return false; }
211
213 virtual void onResendingStarted(SequenceNumber /*beginSeqNo*/, SequenceNumber /*endSeqNo*/, Session* /*session*/) {}
214
216 virtual void onResendingFinished(SequenceNumber /*beginSeqNo*/, SequenceNumber /*endSeqNo*/, Session* /*session*/) {}
217
219 virtual void onError(ErrorReason::Enum /*reason*/, const std::string & /*description*/, Session * /*session*/) {}
220
222 virtual void onWarning(WarningReason::Enum /*reason*/, const std::string & /*description*/, Session * /*session*/) {}
223};
224}
225}
#define ONIXS_FIXENGINE_API_DECL(typeKind, typeName)
Definition ABI.h:57
#define ONIXS_FIXENGINE_API
Definition ABI.h:45
#define ONIXS_FIXENGINE_DEFAULT
Definition Compiler.h:194
Provides an access to FIX fields from a flat (tag=value) message.
The session's Listener.
virtual void onError(ErrorReason::Enum, const std::string &, Session *)
Is called when an error condition is detected.
virtual bool onResendRequest(FlatMessage &, Session *)
Is called when the message mode is FlatMessage and the sent application-level message is about to be ...
virtual void onReceivedBytes(const char *, size_t, const ReceivedDataTimestamp &, Session *)
Is called as soon as bytes are received from the wire.
virtual void onOutboundApplicationMsg(Message &, Session *)
Is called when the application-level message is sent to the counterparty.
virtual void onInboundSessionMsg(FlatMessage &, Session *)
Is called when the message mode is FlatMessage and the session-level message is received from the cou...
virtual void onMessageSending(SequenceNumber, char *, size_t, Session *)
Is called just before the FIX message is sent to the wire.
virtual void onStateChange(SessionState::Enum, SessionState::Enum, Session *)
Is called when the session changes its state.
virtual void onOutboundSessionMsg(Message &, Session *)
Is called when the session-level message is sent to the counterparty.
virtual void onResendingStarted(SequenceNumber, SequenceNumber, Session *)
Is called when the ResendRequest<2> message is received and the session is about to start to resend m...
virtual ~ISessionListener() ONIXS_FIXENGINE_DEFAULT
virtual void onInboundSessionMsg(Message &, Session *)
Is called when the message mode is Message and the session-level message is received from the counter...
virtual void onWarning(WarningReason::Enum, const std::string &, Session *)
Is called when a warning condition is detected.
virtual void onInboundApplicationMsg(Message &message, Session *session)=0
Is called when the message mode is Message and the application-level message is received from the cou...
virtual void onResendingFinished(SequenceNumber, SequenceNumber, Session *)
Is called when the resending process is completed.
virtual bool onResendRequest(Message &, Session *)
Is called when the message mode is Message and the sent application-level message is about to be re-s...
Encapsulates operations over a FIX Message.
Definition Message.h:52
Represents a timestamp of the received data.
@ Software
Timestamp provided by the OS kernel / user-level network stack.
@ Hardware
Timestamp provided by the network card.
@ None
No timestamp available.
std::string toString() const
Returns a human-readable presentation.
ReceivedDataTimestamp(const Timestamp &timestamp, Source source)
const Timestamp & timestamp() const
Returns the received data timestamp.
Source source() const
Returns the source of the received data timestamp.
The FIX Session - a bi-directional stream of ordered messages between two parties within a continuous...
Definition Session.h:98
The timestamps related functionality.
Definition Timestamp.h:92
unsigned int SequenceNumber
Alias for the sequence number.
@ SetSocketOptionError
Socket options cannot be set.
@ ExceptionInEventHandler
An exception was thrown in the client event handler implementation.
@ CannotRestoreConnection
The FIX Connection cannot be restored.
@ GeneralError
The general system-related error.
@ MsgSeqNumTooLow
The incoming message has a sequence number less than expected and the PossDupFlag is not set,...
@ FirstMessageNotALogon
The first message received is not a Logon message.
@ InvalidIncomingMessage
The FIX message received is not valid.
@ ExceptionDuringProcessingOfIncomingMessage
An exception was thrown during processing of the incoming message.
@ SeqGapIsDetected
The sequence gap in the incoming messages is detected.
@ ResendTimeout
The ResendTimeout is elapsed.
@ CannotConnect
Cannot re-establish the FIX Connection after the reconnect attempt.
@ GarbledMessageReceived
A garbled message is received.
@ LinkError
The telecommunication link error is detected.
@ GeneralWarning
The general system-related warning.