proton/receiver.hpp

Go to the documentation of this file.
00001 #ifndef PROTON_RECEIVER_HPP
00002 #define PROTON_RECEIVER_HPP
00003 
00004 /*
00005  *
00006  * Licensed to the Apache Software Foundation (ASF) under one
00007  * or more contributor license agreements.  See the NOTICE file
00008  * distributed with this work for additional information
00009  * regarding copyright ownership.  The ASF licenses this file
00010  * to you under the Apache License, Version 2.0 (the
00011  * "License"); you may not use this file except in compliance
00012  * with the License.  You may obtain a copy of the License at
00013  *
00014  *   http://www.apache.org/licenses/LICENSE-2.0
00015  *
00016  * Unless required by applicable law or agreed to in writing,
00017  * software distributed under the License is distributed on an
00018  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
00019  * KIND, either express or implied.  See the License for the
00020  * specific language governing permissions and limitations
00021  * under the License.
00022  *
00023  */
00024 
00025 #include "./fwd.hpp"
00026 #include "./internal/export.hpp"
00027 #include "./link.hpp"
00028 
00029 #include <proton/type_compat.h>
00030 
00031 struct pn_link_t;
00032 struct pn_session_t;
00033 
00036 
00037 namespace proton {
00038 
00040 class
00041 PN_CPP_CLASS_EXTERN receiver : public link {
00043     PN_CPP_EXTERN receiver(pn_link_t* r);
00045 
00046   public:
00048     receiver() {}
00049 
00050     PN_CPP_EXTERN ~receiver();
00051 
00055     PN_CPP_EXTERN void open();
00056 
00058     PN_CPP_EXTERN void open(const receiver_options &opts);
00059 
00061     PN_CPP_EXTERN class source source() const;
00062 
00064     PN_CPP_EXTERN class target target() const;
00065 
00069     PN_CPP_EXTERN void add_credit(uint32_t);
00070 
00079     PN_CPP_EXTERN void drain();
00080 
00082   friend class internal::factory<receiver>;
00083   friend class receiver_iterator;
00085 };
00086 
00088 
00090 class receiver_iterator : public internal::iter_base<receiver, receiver_iterator> {
00091     explicit receiver_iterator(receiver r, pn_session_t* s = 0) :
00092         internal::iter_base<receiver, receiver_iterator>(r), session_(s) {}
00093 
00094   public:
00096     explicit receiver_iterator() :
00097         internal::iter_base<receiver, receiver_iterator>(0), session_(0) {}
00098 
00100     PN_CPP_EXTERN receiver_iterator operator++();
00101 
00102   private:
00103     pn_session_t* session_;
00104 
00105   friend class connection;
00106   friend class session;
00107 };
00108 
00110 typedef internal::iter_range<receiver_iterator> receiver_range;
00111 
00113 
00114 } // proton
00115 
00116 #endif // PROTON_RECEIVER_HPP

Generated on 17 Jan 2019 for Qpid Proton C++ by  doxygen 1.6.1