Qpid C++ Messaging API  1.39.0
Receiver.h
1 #ifndef QPID_MESSAGING_RECEIVER_H
2 #define QPID_MESSAGING_RECEIVER_H
3 
4 /*
5  *
6  * Licensed to the Apache Software Foundation (ASF) under one
7  * or more contributor license agreements. See the NOTICE file
8  * distributed with this work for additional information
9  * regarding copyright ownership. The ASF licenses this file
10  * to you under the Apache License, Version 2.0 (the
11  * "License"); you may not use this file except in compliance
12  * with the License. You may obtain a copy of the License at
13  *
14  * http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing,
17  * software distributed under the License is distributed on an
18  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
19  * KIND, either express or implied. See the License for the
20  * specific language governing permissions and limitations
21  * under the License.
22  *
23  */
24 #include "qpid/messaging/ImportExport.h"
25 
26 #include "qpid/messaging/exceptions.h"
27 #include "qpid/messaging/Handle.h"
28 #include "qpid/messaging/Duration.h"
29 
30 namespace qpid {
31 namespace messaging {
32 
33 #ifndef SWIG
34 template <class> class PrivateImplRef;
35 #endif
36 
37 class Address;
38 class Message;
39 class ReceiverImpl;
40 class Session;
41 
45 class QPID_MESSAGING_CLASS_EXTERN Receiver : public qpid::messaging::Handle<ReceiverImpl>
46 {
47  public:
48  QPID_MESSAGING_EXTERN Receiver(ReceiverImpl* impl = 0);
49  QPID_MESSAGING_EXTERN Receiver(const Receiver&);
50  QPID_MESSAGING_EXTERN ~Receiver();
51  QPID_MESSAGING_EXTERN Receiver& operator=(const Receiver&);
57  QPID_MESSAGING_EXTERN bool get(Message& message, Duration timeout=Duration::FOREVER);
67  QPID_MESSAGING_EXTERN Message get(Duration timeout=Duration::FOREVER);
79  QPID_MESSAGING_EXTERN bool fetch(Message& message, Duration timeout=Duration::FOREVER);
91  QPID_MESSAGING_EXTERN Message fetch(Duration timeout=Duration::FOREVER);
97  QPID_MESSAGING_EXTERN void setCapacity(uint32_t);
104  QPID_MESSAGING_EXTERN uint32_t getCapacity();
109  QPID_MESSAGING_EXTERN uint32_t getAvailable();
116  QPID_MESSAGING_EXTERN uint32_t getUnsettled();
117 
121  QPID_MESSAGING_EXTERN void close();
122 
126  QPID_MESSAGING_EXTERN bool isClosed() const;
127 
131  QPID_MESSAGING_EXTERN const std::string& getName() const;
132 
136  QPID_MESSAGING_EXTERN Session getSession() const;
137 
141  QPID_MESSAGING_EXTERN Address getAddress() const;
142 
143 #ifndef SWIG
144  private:
145  friend class qpid::messaging::PrivateImplRef<Receiver>;
146 #endif
147 };
148 }} // namespace qpid::messaging
149 
150 #endif
Definition: Address.h:122
Definition: Receiver.h:45
Definition: Connection.h:36
Definition: Duration.h:35
Definition: Message.h:42
Definition: Handle.h:39
Definition: Session.h:49
Definition: Address.h:32