stream.hpp
Go to the documentation of this file.
1 /* SPDX-License-Identifier: MPL-2.0 */
2 
3 #ifndef __ZMQ_STREAM_HPP_INCLUDED__
4 #define __ZMQ_STREAM_HPP_INCLUDED__
5 
6 #include <map>
7 
8 #include "router.hpp"
9 
10 namespace zmq
11 {
12 class ctx_t;
13 class pipe_t;
14 
15 class stream_t ZMQ_FINAL : public routing_socket_base_t
16 {
17  public:
18  stream_t (zmq::ctx_t *parent_, uint32_t tid_, int sid_);
19  ~stream_t ();
20 
21  // Overrides of functions from socket_base_t.
22  void xattach_pipe (zmq::pipe_t *pipe_,
23  bool subscribe_to_all_,
24  bool locally_initiated_);
25  int xsend (zmq::msg_t *msg_);
26  int xrecv (zmq::msg_t *msg_);
27  bool xhas_in ();
28  bool xhas_out ();
29  void xread_activated (zmq::pipe_t *pipe_);
30  void xpipe_terminated (zmq::pipe_t *pipe_);
31  int xsetsockopt (int option_, const void *optval_, size_t optvallen_);
32 
33  private:
34  // Generate peer's id and update lookup map
35  void identify_peer (pipe_t *pipe_, bool locally_initiated_);
36 
37  // Fair queueing object for inbound pipes.
38  fq_t _fq;
39 
40  // True iff there is a message held in the pre-fetch buffer.
42 
43  // If true, the receiver got the message part with
44  // the peer's identity.
46 
47  // Holds the prefetched identity.
49 
50  // Holds the prefetched message.
52 
53  // The pipe we are currently writing to.
54  zmq::pipe_t *_current_out;
55 
56  // If true, more outgoing message parts are expected.
57  bool _more_out;
58 
59  // Routing IDs are generated. It's a simple increment and wrap-over
60  // algorithm. This value is the next ID to use (if not used already).
62 
64 };
65 }
66 
67 #endif
zmq::ZMQ_FINAL::_prefetched_msg
msg_t _prefetched_msg
Definition: stream.hpp:51
router.hpp
zmq
Definition: zmq.hpp:229
ZMQ_NON_COPYABLE_NOR_MOVABLE
#define ZMQ_NON_COPYABLE_NOR_MOVABLE(classname)
Definition: macros.hpp:58
zmq::ZMQ_FINAL::_prefetched
bool _prefetched
Definition: stream.hpp:41
zmq::ZMQ_FINAL::_next_integral_routing_id
uint32_t _next_integral_routing_id
Definition: stream.hpp:61
zmq::ZMQ_FINAL::_prefetched_routing_id
msg_t _prefetched_routing_id
Definition: stream.hpp:48
zmq::ZMQ_FINAL::_current_out
zmq::pipe_t * _current_out
Definition: stream.hpp:54
zmq::ZMQ_FINAL::_routing_id_sent
bool _routing_id_sent
Definition: stream.hpp:45
ZMQ_FINAL
Definition: unittest_ip_resolver.cpp:26
zmq::msg_t
Definition: msg.hpp:33


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