libbmq  a5f8a06ba1d16cb5a65643e1fa7f1a1d6aadef40
bmqa_messageiterator.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_messageiterator.h -*-C++-*-
17 #ifndef INCLUDED_BMQA_MESSAGEITERATOR
18 #define INCLUDED_BMQA_MESSAGEITERATOR
19 
40 
41 // BMQ
42 
43 #include <bmqa_message.h>
44 
45 // BDE
46 #include <ball_log.h>
47 
48 namespace BloombergLP {
49 
50 // FORWARD DECLARATION
51 namespace bmqimp {
52 class Event;
53 }
54 
55 namespace bmqa {
56 
57 // ==========================
58 // struct MessageIteratorImpl
59 // ==========================
60 
65 struct MessageIteratorImpl {
66  // PUBLIC DATA
67 
69  bmqimp::Event* d_event_p;
70 
75  bmqa::Message d_message;
76 
78  int d_messageIndex;
79 };
80 
81 // =====================
82 // class MessageIterator
83 // =====================
84 
88  private:
89  // CLASS-SCOPE CATEGORY
90  BALL_LOG_SET_CLASS_CATEGORY("BMQA.MESSAGEITERATOR");
91 
92  private:
93  // DATA
94  MessageIteratorImpl d_impl; // Implementation. Abstracted in its own
95  // struct and private so that we can do some
96  // magic to manipulate it without exposing any
97  // accessors/manipulators (this is wanted
98  // since this class is a public class).
99 
100  public:
101  // CREATORS
102 
105 
106  // MANIPULATORS
107 
113  bool nextMessage();
114 
115  // ACCESSORS
116 
121  const Message& message() const;
122 };
123 
124 } // close package namespace
125 } // close enterprise namespace
126 
127 #endif
Provide the application with a message data object.
Definition: bmqa_messageiterator.h:87
const Message & message() const
MessageIterator()
Default constructor.
A message sent/received to/from the BlazingMQ broker.
Definition: bmqa_message.h:170
Definition: bmqa_abstractsession.h:42