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 
00053     PN_CPP_EXTERN void open();
00054 
00056     PN_CPP_EXTERN void open(const receiver_options &opts);
00057 
00059     PN_CPP_EXTERN class source source() const;
00060 
00062     PN_CPP_EXTERN class target target() const;
00063 
00067     PN_CPP_EXTERN void add_credit(uint32_t);
00068 
00077     PN_CPP_EXTERN void drain();
00078 
00080   friend class internal::factory<receiver>;
00081   friend class receiver_iterator;
00083 };
00084 
00086 
00088 class receiver_iterator : public internal::iter_base<receiver, receiver_iterator> {
00089     explicit receiver_iterator(receiver r, pn_session_t* s = 0) :
00090         internal::iter_base<receiver, receiver_iterator>(r), session_(s) {}
00091 
00092   public:
00094     explicit receiver_iterator() :
00095         internal::iter_base<receiver, receiver_iterator>(0), session_(0) {}
00096 
00098     PN_CPP_EXTERN receiver_iterator operator++();
00099 
00100   private:
00101     pn_session_t* session_;
00102 
00103   friend class connection;
00104   friend class session;
00105 };
00106 
00108 typedef internal::iter_range<receiver_iterator> receiver_range;
00109 
00111 
00112 } // proton
00113 
00114 #endif // PROTON_RECEIVER_HPP

Generated on 1 Jun 2020 for Qpid Proton C++ by  doxygen 1.6.1