libbmq 57a4779af25c7e9db2550c596f277dd91da7e3c2
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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_string.h>
60
61namespace BloombergLP {
62
63// FORWARD DECLARATION
64namespace bmqimp {
65class Event;
66}
67
68namespace bmqa {
69
70// ==================
71// class SessionEvent
72// ==================
73
76 private:
77 // FRIENDS
78 friend bool operator==(const SessionEvent& lhs, const SessionEvent& rhs);
79 friend bool operator!=(const SessionEvent& lhs, const SessionEvent& rhs);
80
81 private:
82 // DATA
83 bsl::shared_ptr<bmqimp::Event> d_impl_sp; // pimpl
84
85 public:
86 // CREATORS
87
90
94
95 // MANIPULATORS
96
100
101 // ACCESSORS
102
105
108
113
116 int statusCode() const;
117
120 const bsl::string& errorDescription() const;
121
131 bsl::ostream&
132 print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const;
133};
134
135// FREE OPERATORS
136
140bool operator==(const SessionEvent& lhs, const SessionEvent& rhs);
141
145bool operator!=(const SessionEvent& lhs, const SessionEvent& rhs);
146
149bsl::ostream& operator<<(bsl::ostream& stream, const SessionEvent& rhs);
150
151} // close package namespace
152
153// ============================================================================
154// INLINE DEFINITIONS
155// ============================================================================
156
157// ------------------
158// class SessionEvent
159// ------------------
160
161inline bsl::ostream& bmqa::operator<<(bsl::ostream& stream,
162 const bmqa::SessionEvent& rhs)
163{
164 return rhs.print(stream, 0, -1);
165}
166
167} // close enterprise namespace
168
169#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:75
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