OnixS C++ B3 BOE Binary Order Entry 1.3.0
API Documentation
Loading...
Searching...
No Matches
SessionException.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
25
26#include <string>
27
28#if WIN32
29#pragma warning(push)
30#pragma warning(disable : 4275)
31#pragma warning(disable : 4251)
32#endif
33
34namespace OnixS {
35namespace B3 {
36namespace BOE {
37namespace Exceptions{
38
42class ONIXS_B3_BOE_EXPORTED SessionException : public std::exception
43{
44public:
45 SessionException(SessionErrorReason::Enum reason, const std::string& message);
46
47 SessionException(SessionErrorReason::Enum reason, const std::string& message, const std::exception& cause);
48
50
52
54 {
55 return reason_;
56 }
57
58 const std::string& toString() const ONIXS_B3_BOE_NOTHROW
59 {
60 return message_;
61 }
62
63private:
64 std::string message_;
66};
67
68
82
83template <typename MessageType>
96
110
122
128{
129public:
132
134
136 {
137 return actualSeqNum_;
138 }
139
141 {
142 return expectedSeqNum_;
143 }
144
145 Messaging::UInt64 sessionVerId() const ONIXS_B3_BOE_NOTHROW
146 {
147 return sessionVerId_;
148 }
149
150private:
151 SeqNumber actualSeqNum_;
152 SeqNumber expectedSeqNum_;
153 Messaging::UInt64 sessionVerId_;
154};
155
160 : public SessionException
161{
162public:
163 explicit ResponseTimeoutException(const std::string& rejectReason, int timeoutMilliseconds)
164 : SessionException(SessionErrorReason::LinkErrorIsDetected, rejectReason)
165 , timeout_(timeoutMilliseconds)
166 {}
167
169
172 {
173 return timeout_;
174 }
175
176private:
177 int timeout_;
178};
179
180
192
211
212
226
240
253
268
269}
270}
271}
272}
273
274#if WIN32
275#pragma warning(pop)
276#endif
#define ONIXS_B3_BOE_DEFAULT
Definition Compiler.h:208
#define ONIXS_B3_BOE_OVERRIDE
Definition Compiler.h:186
#define ONIXS_B3_BOE_EXPORTED
Definition Compiler.h:181
#define ONIXS_B3_BOE_NOTHROW
Definition Compiler.h:182
BusinessRejectInReplyOnEstablishException(Messaging::BusinessMessageReject206 reject)
CannotEstablishLinkException(int errCode, const std::string &rejectReason)
Constructor.
~EstablishRejectException() noexcept override=default
EstablishRejectException(Messaging::EstablishReject6 reject)
Messaging::EstablishRejectCode::Enum errorCodes() const
LinkErrorException(const std::string &rejectReason)
~LinkErrorException() noexcept override=default
Messaging::NegotiationRejectCode::Enum errorCodes() const
NegotiateRejectException(Messaging::NegotiateReject3 reject)
~NegotiateRejectException() noexcept override=default
ResponseTimeoutException(const std::string &rejectReason, int timeoutMilliseconds)
~ResponseTimeoutException() noexcept override=default
SbeMessageAttachedExceptionBase(SessionErrorReason::Enum reason, const std::string &message, Messaging::SbeMessage sbeMessage)
SessionException(SessionErrorReason::Enum reason, const std::string &message, const std::exception &cause)
SessionErrorReason::Enum reason() const noexcept
const std::string & toString() const noexcept
SessionException(SessionErrorReason::Enum reason, const std::string &message)
const char * what() const noexcept override
~SessionException() noexcept override=default
TerminateInReplyOnEstablishException(Messaging::Terminate7 terminate)
Messaging::TerminationCode::Enum errorCodes() const
TypedSbeMessageAttachedExceptionBase(SessionErrorReason::Enum reason, const std::string &message, Messaging::SbeMessage sbeMessage)
UnexpectedMessageTypeException(Messaging::SbeMessage message)
Messaging::MessageTemplateId templateId() const
UnexpectedSequenceNumberException(Messaging::SbeMessage receivedMessage, const std::string &rejectReason, SeqNumber actualSeqNum, SeqNumber expectedSeqNum, Messaging::UInt64 sessionVerId)
Message typify(const SbeMessage &message)
Casts SBE-encoded message to a given type.
UInt32 RejReason
Code to identify reason for order rejection.
Definition Fields.h:225
MessageHeader::TemplateId MessageTemplateId
Message type (template) identification.
Messaging::UInt32 SeqNumber
Definition Messaging.h:52
BusinessMessageReject message can reject an application-level message which fulfills session level ru...
Definition Messages.h:16562
EstablishmentReject message is sent when an Establish message is rejected by B3 informing the reason ...
Definition Messages.h:2187
Identifies the code of reject establishment.
Definition Fields.h:1232
NegotiateReject message is sent when B3 rejects a Negotiate message sent by the client.
Definition Messages.h:971
Identifies the code of reject negotiation.
Definition Fields.h:1174
Terminate message is sent to indicate that the sender is going to disconnect the TCP socket connectio...
Definition Messages.h:2548
Identifies the code of termination.
Definition Fields.h:1296