libbmq  a5f8a06ba1d16cb5a65643e1fa7f1a1d6aadef40
bmqa_messageevent.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_messageevent.h -*-C++-*-
17 #ifndef INCLUDED_BMQA_MESSAGEEVENT
18 #define INCLUDED_BMQA_MESSAGEEVENT
19 
39 
40 // BMQ
41 
42 #include <bmqa_messageiterator.h>
43 #include <bmqt_messageeventtype.h>
44 
45 // BDE
46 #include <bsl_iosfwd.h>
47 #include <bsl_memory.h>
48 
49 namespace BloombergLP {
50 
51 // FORWARD DECLARATION
52 namespace bmqimp {
53 class Event;
54 }
55 
56 namespace bmqa {
57 
58 // ==================
59 // class MessageEvent
60 // ==================
61 
64 class MessageEvent {
65  private:
66  // DATA
67  bsl::shared_ptr<bmqimp::Event> d_impl_sp; // pimpl
68 
69  public:
70  // CREATORS
71 
75 
76  // ACCESSORS
77 
84 
87 
97  bsl::ostream&
98  print(bsl::ostream& stream, int level = 0, int spacesPerLevel = 4) const;
99 };
100 
101 // FREE OPERATORS
102 
105 bsl::ostream& operator<<(bsl::ostream& stream, const MessageEvent& rhs);
106 
107 // ============================================================================
108 // INLINE DEFINITIONS
109 // ============================================================================
110 
111 } // close package namespace
112 
113 // ------------------
114 // class MessageEvent
115 // ------------------
116 
117 inline bsl::ostream& bmqa::operator<<(bsl::ostream& stream,
118  const bmqa::MessageEvent& rhs)
119 {
120  return rhs.print(stream, 0, -1);
121 }
122 
123 } // close enterprise namespace
124 
125 #endif
Provide a mechanism to iterate over the messages of a bmqa::MessageEvent.
Provide an enumeration for the different types of message events.
Definition: bmqa_messageevent.h:64
bmqt::MessageEventType::Enum type() const
Return the type of messages contained in this MessageEvent.
bsl::ostream & print(bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
MessageIterator messageIterator() const
Definition: bmqa_messageiterator.h:87
bsl::ostream & operator<<(bsl::ostream &stream, const CloseQueueStatus &rhs)
Definition: bmqa_closequeuestatus.h:227
Definition: bmqa_abstractsession.h:42
Enum
Definition: bmqt_messageeventtype.h:48