fq.hpp
Go to the documentation of this file.
1 /* SPDX-License-Identifier: MPL-2.0 */
2 
3 #ifndef __ZMQ_FQ_HPP_INCLUDED__
4 #define __ZMQ_FQ_HPP_INCLUDED__
5 
6 #include "array.hpp"
7 #include "blob.hpp"
8 
9 namespace zmq
10 {
11 class msg_t;
12 class pipe_t;
13 
14 // Class manages a set of inbound pipes. On receive it performs fair
15 // queueing so that senders gone berserk won't cause denial of
16 // service for decent senders.
17 
18 class fq_t
19 {
20  public:
21  fq_t ();
22  ~fq_t ();
23 
24  void attach (pipe_t *pipe_);
25  void activated (pipe_t *pipe_);
26  void pipe_terminated (pipe_t *pipe_);
27 
28  int recv (msg_t *msg_);
29  int recvpipe (msg_t *msg_, pipe_t **pipe_);
30  bool has_in ();
31 
32  private:
33  // Inbound pipes.
36 
37  // Number of active pipes. All the active pipes are located at the
38  // beginning of the pipes array.
40 
41  // Index of the next bound pipe to read a message from.
43 
44  // If true, part of a multipart message was already received, but
45  // there are following parts still waiting in the current pipe.
46  bool _more;
47 
49 };
50 }
51 
52 #endif
zmq::fq_t::pipes_t
array_t< pipe_t, 1 > pipes_t
Definition: fq.hpp:34
zmq::fq_t::_active
pipes_t::size_type _active
Definition: fq.hpp:39
array.hpp
zmq::fq_t::~fq_t
~fq_t()
Definition: fq.cpp:13
zmq::fq_t
Definition: fq.hpp:18
zmq
Definition: zmq.hpp:229
zmq::fq_t::fq_t
fq_t()
Definition: fq.cpp:9
zmq::fq_t::_more
bool _more
Definition: fq.hpp:46
zmq::fq_t::activated
void activated(pipe_t *pipe_)
Definition: fq.cpp:40
zmq::fq_t::attach
void attach(pipe_t *pipe_)
Definition: fq.cpp:18
ZMQ_NON_COPYABLE_NOR_MOVABLE
#define ZMQ_NON_COPYABLE_NOR_MOVABLE(classname)
Definition: macros.hpp:58
zmq::fq_t::pipe_terminated
void pipe_terminated(pipe_t *pipe_)
Definition: fq.cpp:25
zmq::array_t< pipe_t, 1 >::size_type
std::vector< pipe_t * >::size_type size_type
Definition: array.hpp:52
zmq::fq_t::has_in
bool has_in()
Definition: fq.cpp:96
zmq::fq_t::recvpipe
int recvpipe(msg_t *msg_, pipe_t **pipe_)
Definition: fq.cpp:52
zmq::fq_t::recv
int recv(msg_t *msg_)
Definition: fq.cpp:47
zmq::fq_t::_pipes
pipes_t _pipes
Definition: fq.hpp:35
blob.hpp
zmq::fq_t::_current
pipes_t::size_type _current
Definition: fq.hpp:42
zmq::array_t< pipe_t, 1 >
zmq::msg_t
Definition: msg.hpp:33


libaditof
Author(s):
autogenerated on Wed May 21 2025 02:06:51