OnixS C++ ICE Binary Order Entry Handler 1.1.1
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:
39 explicit SessionException(SessionErrorReason::Enum reason, std::string message);
40
41 ~SessionException() override = default;
42
44 ONIXS_ICEBOE_NODISCARD const char* what() const noexcept override;
45
48
50 ONIXS_ICEBOE_NODISCARD const std::string& toString() const noexcept;
51
52private:
53 std::string message_;
54 SessionErrorReason::Enum reason_;
55};
56
59{
60public:
65 SessionErrorReason::Enum reason, std::string message, Messaging::SbeMessage sbeMessage);
66
69
72
73private:
74 std::vector<unsigned char> buffer_;
75};
76
79template <typename MessageType>
93
106
109 : public SessionException
110{
111public:
113 explicit LinkErrorException(std::string rejectReason);
114
115 ~LinkErrorException() override = default;
116};
117
143
146 : public SessionException
147{
148public:
151 explicit ResponseTimeoutException(std::string rejectReason, int timeoutMilliseconds);
152
153 ~ResponseTimeoutException() override = default;
154
156 ONIXS_ICEBOE_NODISCARD int timeout() const noexcept;
157
158private:
159 int timeout_;
160};
161
171
174 : public SessionException
175{
176public:
179 CannotEstablishLinkException(int errCode, std::string rejectReason);
180
181 ~CannotEstablishLinkException() override = default;
182
184 ONIXS_ICEBOE_NODISCARD int errCode() const noexcept;
185
186private:
187 int errCode_;
188};
189
200
211
214 : public TypedSbeMessageAttachedExceptionBase<Messaging::Error>
215{
216public:
219
220 ~ErrorOnLogonRequestException() override = default;
221};
222
223}
#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:155
#define ONIXS_ICEBOE_NODISCARD
Definition Compiler.h:156
CannotEstablishLinkException(int errCode, std::string rejectReason)
LogonRequestRejectException(Messaging::LogonReport reject)
LogoutReportInReplyOnLogonRequestException(Messaging::LogoutReport terminate)
ResponseTimeoutException(std::string rejectReason, int timeoutMilliseconds)
SbeMessageAttachedExceptionBase(SessionErrorReason::Enum reason, std::string message, Messaging::SbeMessage sbeMessage)
~SbeMessageAttachedExceptionBase() override=0
Abstract base class.
SessionException(SessionErrorReason::Enum reason, std::string message)
SessionErrorReason::Enum reason() const noexcept
const std::string & toString() const noexcept
const char * what() const noexcept override
TypedSbeMessageAttachedExceptionBase(SessionErrorReason::Enum reason, std::string message, Messaging::SbeMessage sbeMessage)
UnexpectedMessageTypeException(Messaging::SbeMessage message)
UnexpectedSequenceNumberException(Messaging::SbeMessage receivedMessage, 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.
decltype(std::declval< const Messaging::SbeMessage & >().sequenceId()) SeqNumber
Definition Messaging.h:53
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