OnixS C++ ICE Binary Order Entry Handler 1.0.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
29namespace Exceptions{
30
34class ONIXS_ICEBOE_EXPORTED SessionException : public std::exception
35{
36public:
37 SessionException(SessionErrorReason::Enum reason, const std::string& message);
38
39 SessionException(SessionErrorReason::Enum reason, const std::string& message, const std::exception& cause);
40
41 ~SessionException() noexcept override = default;
42
43 const char* what() const noexcept override;
44
45 SessionErrorReason::Enum reason() const noexcept
46 {
47 return reason_;
48 }
49
50 const std::string& toString() const noexcept
51 {
52 return message_;
53 }
54
55private:
56 std::string message_;
58};
59
60
62 : public SessionException
63{
64public:
66
68
69 ~SbeMessageAttachedExceptionBase() noexcept override = 0;
70
71private:
72 std::vector<unsigned char> buffer_;
73};
74
75template <typename MessageType>
88
102
107 : public SessionException
108{
109public:
110 explicit LinkErrorException(const std::string& rejectReason);
111
112 ~LinkErrorException() noexcept override = default;
113};
114
120{
121public:
124
125 ~UnexpectedSequenceNumberException() noexcept override = default;
126
127 SeqNumber actualSeqNum() const noexcept
128 {
129 return actualSeqNum_;
130 }
131
132 SeqNumber expectedSeqNum() const noexcept
133 {
134 return expectedSeqNum_;
135 }
136
137private:
138 SeqNumber actualSeqNum_;
139 SeqNumber expectedSeqNum_;
140};
141
146 : public SessionException
147{
148public:
149 explicit ResponseTimeoutException(const std::string& rejectReason, int timeoutMilliseconds)
150 : SessionException(SessionErrorReason::LinkErrorIsDetected, rejectReason)
151 , timeout_(timeoutMilliseconds)
152 {}
153
154 ~ResponseTimeoutException() noexcept override = default;
155
157 int timeout() const noexcept
158 {
159 return timeout_;
160 }
161
162private:
163 int timeout_;
164};
165
166
178
181 : public SessionException
182{
183public:
188 CannotEstablishLinkException(int errCode, const std::string& rejectReason);
189
190 ~CannotEstablishLinkException() noexcept override = default;
191
192 int errCode() const noexcept;
193
194private:
195 int errCode_;
196};
197
206
216
225
226}
#define ONIXS_ICEBOE_NAMESPACE_BEGIN
Definition ABI.h:94
#define ONIXS_ICEBOE_NAMESPACE_END
Definition ABI.h:98
#define ONIXS_ICEBOE_EXPORTED
Definition Compiler.h:153
CannotEstablishLinkException(int errCode, const std::string &rejectReason)
Constructor.
LinkErrorException(const std::string &rejectReason)
~LinkErrorException() noexcept override=default
LogonRequestRejectException(Messaging::LogonReport reject)
LogoutReportInReplyOnLogonRequestException(Messaging::LogoutReport terminate)
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
TypedSbeMessageAttachedExceptionBase(SessionErrorReason::Enum reason, const std::string &message, Messaging::SbeMessage sbeMessage)
UnexpectedMessageTypeException(Messaging::SbeMessage message)
UnexpectedSequenceNumberException(Messaging::SbeMessage receivedMessage, const std::string &rejectReason, SeqNumber actualSeqNum, SeqNumber expectedSeqNum)
auto typify(SbeMessage message)
Casts SBE-encoded message to a given type.
MessageHeader::TemplateId MessageTemplateId
Message type (template) identification.
Messaging::UInt32 SeqNumber
Definition Messaging.h:51
Error processing client request.
Definition Messages.h:1339
Logon Report for Gateway ID.
Definition Messages.h:393
Logout Report for Gateway ID.
Definition Messages.h:903