Qpid C++ Messaging API  0.20
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Receiver.h
Go to the documentation of this file.
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  */
25 
27 #include "qpid/messaging/Handle.h"
29 
30 namespace qpid {
31 namespace messaging {
32 
33 #ifndef SWIG
34 template <class> class PrivateImplRef;
35 #endif
36 
37 class Message;
38 class ReceiverImpl;
39 class Session;
40 
45 {
46  public:
47  QPID_MESSAGING_EXTERN Receiver(ReceiverImpl* impl = 0);
48  QPID_MESSAGING_EXTERN Receiver(const Receiver&);
49  QPID_MESSAGING_EXTERN ~Receiver();
50  QPID_MESSAGING_EXTERN Receiver& operator=(const Receiver&);
56  QPID_MESSAGING_EXTERN bool get(Message& message, Duration timeout=Duration::FOREVER);
78  QPID_MESSAGING_EXTERN bool fetch(Message& message, Duration timeout=Duration::FOREVER);
96  QPID_MESSAGING_EXTERN void setCapacity(uint32_t);
103  QPID_MESSAGING_EXTERN uint32_t getCapacity();
108  QPID_MESSAGING_EXTERN uint32_t getAvailable();
115  QPID_MESSAGING_EXTERN uint32_t getUnsettled();
116 
120  QPID_MESSAGING_EXTERN void close();
121 
125  QPID_MESSAGING_EXTERN bool isClosed() const;
126 
130  QPID_MESSAGING_EXTERN const std::string& getName() const;
131 
135  QPID_MESSAGING_EXTERN Session getSession() const;
136 
137 #ifndef SWIG
138  private:
139  friend class qpid::messaging::PrivateImplRef<Receiver>;
140 #endif
141 };
142 }} // namespace qpid::messaging
143 
144 #endif