OnixS C++ CME iLink 3 Binary Order Entry Handler 1.19.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 CME {
36namespace iLink3 {
37namespace Exceptions{
38
42class ONIXS_ILINK3_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
49 ~SessionException() noexcept override = default;
50
51 const char* what() const noexcept override;
52
53 SessionErrorReason::Enum reason() const noexcept
54 {
55 return reason_;
56 }
57
58 const std::string& toString() const noexcept
59 {
60 return message_;
61 }
62
63private:
64 std::string message_;
66};
67
68
70 : public SessionException
71{
72public:
74
76
77 ~SbeMessageAttachedExceptionBase() noexcept override = 0;
78
79private:
80 std::vector<unsigned char> buffer_;
81};
82
83template <typename MessageType>
96
110
115 : public SessionException
116{
117public:
118 explicit LinkErrorException(const std::string& rejectReason);
119
120 ~LinkErrorException() override = default;
121};
122
128{
129public:
132
134
135 SeqNumber actualSeqNum() const noexcept
136 {
137 return actualSeqNum_;
138 }
139
140 SeqNumber expectedSeqNum() const noexcept
141 {
142 return expectedSeqNum_;
143 }
144
145 Messaging::UInt64 uuid() const noexcept
146 {
147 return uuid_;
148 }
149
150private:
151 SeqNumber actualSeqNum_;
152 SeqNumber expectedSeqNum_;
153 Messaging::UInt64 uuid_;
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
168 ~ResponseTimeoutException() override = default;
169
171 int timeout() const noexcept
172 {
173 return timeout_;
174 }
175
176private:
177 int timeout_;
178};
179
180
192
195 : public SessionException
196{
197public:
202 CannotEstablishLinkException(int errCode, const std::string& rejectReason);
203
204 ~CannotEstablishLinkException() override = default;
205
206 int errCode() const noexcept;
207
208private:
209 int errCode_;
210};
211
212
228
244
260
276
277
278
279
280}
281}
282}
283}
284
285#if WIN32
286#pragma warning(pop)
287#endif
#define ONIXS_ILINK3_EXPORTED
Definition Compiler.h:145
BusinessRejectInReplyOnEstablishException(Messaging::BusinessReject521 reject)
CannotEstablishLinkException(int errCode, const std::string &rejectReason)
Constructor.
EstablishmentRejectErrorCode::Enum errorCodes() const
EstablishmentRejectException(Messaging::EstablishmentReject505 reject)
LinkErrorException(const std::string &rejectReason)
NegotiationRejectErrorCode::Enum errorCodes() const
NegotiationRejectException(Messaging::NegotiationReject502 reject)
ResponseTimeoutException(const std::string &rejectReason, int timeoutMilliseconds)
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::Terminate507 terminate)
TypedSbeMessageAttachedExceptionBase(SessionErrorReason::Enum reason, const std::string &message, Messaging::SbeMessage sbeMessage)
UnexpectedSequenceNumberException(Messaging::SbeMessage receivedMessage, const std::string &rejectReason, SeqNumber actualSeqNum, SeqNumber expectedSeqNum, Messaging::UInt64 uuid)
Message typify(const SbeMessage &message)
Casts SBE-encoded message to a given type.
MessageHeader::TemplateId MessageTemplateId
Message type (template) identification.
Messaging::UInt32 SeqNumber
Definition Messaging.h:60