libbmq b6028b29b733bc7541593d2905a5f79a9f0192fc
Loading...
Searching...
No Matches
bmqa_sessionevent.h
Go to the documentation of this file.
1// Copyright 2014-2023 Bloomberg Finance L.P.
2// SPDX-License-Identifier: Apache-2.0
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15
16// bmqa_sessionevent.h -*-C++-*-
17#ifndef INCLUDED_BMQA_SESSIONEVENT
18#define INCLUDED_BMQA_SESSIONEVENT
19
50
51// BMQ
52
53#include <bmqa_queueid.h>
54#include <bmqt_correlationid.h>
56
57// BDE
58#include <bsl_memory.h>
59#include <bsl_ostream.h>
60#include <bsl_string.h>
61
62namespace BloombergLP {
63
64// FORWARD DECLARATION
65namespace bmqimp {
66class Event;
67}
68
69namespace bmqa {
70
71// ==================
72// class SessionEvent
73// ==================
74
77 private:
78 // FRIENDS
79 friend bool operator==(const SessionEvent& lhs, const SessionEvent& rhs);
80 friend bool operator!=(const SessionEvent& lhs, const SessionEvent& rhs);
81
82 private:
83 // DATA
84 bsl::shared_ptr<bmqimp::Event> d_impl_sp; // pimpl
85
86 public:
87 // CREATORS
88
91
95
96 // MANIPULATORS
97
101
102 // ACCESSORS
103
106
109
114
117 int statusCode() const;
118
121 const bsl::string& errorDescription() const;
122
132 bsl::ostream&
133 print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const;
134};
135
136// FREE OPERATORS
137
141bool operator==(const SessionEvent& lhs, const SessionEvent& rhs);
142
146bool operator!=(const SessionEvent& lhs, const SessionEvent& rhs);
147
150bsl::ostream& operator<<(bsl::ostream& stream, const SessionEvent& rhs);
151
152} // close package namespace
153
154// ============================================================================
155// INLINE DEFINITIONS
156// ============================================================================
157
158// ------------------
159// class SessionEvent
160// ------------------
161
162inline bsl::ostream& bmqa::operator<<(bsl::ostream& stream,
163 const bmqa::SessionEvent& rhs)
164{
165 return rhs.print(stream, 0, -1);
166}
167
168} // close enterprise namespace
169
170#endif
Provide a value-semantic efficient identifier for a queue.
Provide a value-semantic type usable as an efficient identifier.
Provide an enumeration for the different types of session events.
Value-semantic efficient identifier for a queue.
Definition bmqa_queueid.h:59
An event related to the operation of a Session.
Definition bmqa_sessionevent.h:76
SessionEvent(const SessionEvent &other)
SessionEvent & operator=(const SessionEvent &rhs)
bsl::ostream & print(bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
bmqt::SessionEventType::Enum type() const
Return the session event type.
const bmqt::CorrelationId & correlationId() const
Return the correlationId associated to this event, if any.
friend bool operator!=(const SessionEvent &lhs, const SessionEvent &rhs)
friend bool operator==(const SessionEvent &lhs, const SessionEvent &rhs)
const bsl::string & errorDescription() const
SessionEvent()
Default constructor.
Definition bmqt_correlationid.h:193
bool operator!=(const CloseQueueStatus &lhs, const CloseQueueStatus &rhs)
Definition bmqa_closequeuestatus.h:240
bool operator==(const CloseQueueStatus &lhs, const CloseQueueStatus &rhs)
Definition bmqa_closequeuestatus.h:233
bsl::ostream & operator<<(bsl::ostream &stream, const CloseQueueStatus &rhs)
Definition bmqa_closequeuestatus.h:227
Definition bmqa_abstractsession.h:42
Enum
Definition bmqt_sessioneventtype.h:116