command.hpp
Go to the documentation of this file.
1 /* SPDX-License-Identifier: MPL-2.0 */
2 
3 #ifndef __ZMQ_COMMAND_HPP_INCLUDED__
4 #define __ZMQ_COMMAND_HPP_INCLUDED__
5 
6 #include <string>
7 #include "stdint.hpp"
8 #include "endpoint.hpp"
9 #include "platform.hpp"
10 
11 namespace zmq
12 {
13 class object_t;
14 class own_t;
15 struct i_engine;
16 class pipe_t;
17 class socket_base_t;
18 
19 // This structure defines the commands that can be sent between threads.
20 
21 struct command_t
22 {
23  // Object to process the command.
25 
26  enum type_t
27  {
30  own,
50  } type;
51 
52  union args_t
53  {
54  // Sent to I/O thread to let it know that it should
55  // terminate itself.
56  struct
57  {
58  } stop;
59 
60  // Sent to I/O object to make it register with its I/O thread.
61  struct
62  {
63  } plug;
64 
65  // Sent to socket to let it know about the newly created object.
66  struct
67  {
69  } own;
70 
71  // Attach the engine to the session. If engine is NULL, it informs
72  // session that the connection have failed.
73  struct
74  {
75  struct i_engine *engine;
76  } attach;
77 
78  // Sent from session to socket to establish pipe(s) between them.
79  // Caller have used inc_seqnum beforehand sending the command.
80  struct
81  {
82  zmq::pipe_t *pipe;
83  } bind;
84 
85  // Sent by pipe writer to inform dormant pipe reader that there
86  // are messages in the pipe.
87  struct
88  {
89  } activate_read;
90 
91  // Sent by pipe reader to inform pipe writer about how many
92  // messages it has read so far.
93  struct
94  {
95  uint64_t msgs_read;
97 
98  // Sent by pipe reader to writer after creating a new inpipe.
99  // The parameter is actually of type pipe_t::upipe_t, however,
100  // its definition is private so we'll have to do with void*.
101  struct
102  {
103  void *pipe;
104  } hiccup;
105 
106  // Sent by pipe reader to pipe writer to ask it to terminate
107  // its end of the pipe.
108  struct
109  {
110  } pipe_term;
111 
112  // Pipe writer acknowledges pipe_term command.
113  struct
114  {
115  } pipe_term_ack;
116 
117  // Sent by one of pipe to another part for modify hwm
118  struct
119  {
120  int inhwm;
121  int outhwm;
122  } pipe_hwm;
123 
124  // Sent by I/O object ot the socket to request the shutdown of
125  // the I/O object.
126  struct
127  {
129  } term_req;
130 
131  // Sent by socket to I/O object to start its shutdown.
132  struct
133  {
134  int linger;
135  } term;
136 
137  // Sent by I/O object to the socket to acknowledge it has
138  // shut down.
139  struct
140  {
141  } term_ack;
142 
143  // Sent by session_base (I/O thread) to socket (application thread)
144  // to ask to disconnect the endpoint.
145  struct
146  {
148  } term_endpoint;
149 
150  // Transfers the ownership of the closed socket
151  // to the reaper thread.
152  struct
153  {
155  } reap;
156 
157  // Closed socket notifies the reaper that it's already deallocated.
158  struct
159  {
160  } reaped;
161 
162  // Send application-side pipe count and ask to send monitor event
163  struct
164  {
165  uint64_t queue_count;
168  } pipe_peer_stats;
169 
170  // Collate application thread and I/O thread pipe counts and endpoints
171  // and send as event
172  struct
173  {
178 
179  // Sent by reaper thread to the term thread when all the sockets
180  // are successfully deallocated.
181  struct
182  {
183  } done;
184 
185  } args;
186 #ifdef _MSC_VER
187 };
188 #else
189 }
190 #ifdef HAVE_POSIX_MEMALIGN
191 __attribute__ ((aligned (ZMQ_CACHELINE_SIZE)))
192 #endif
193 ;
194 #endif
195 }
196 
197 #endif
zmq::command_t::args_t::attach
struct zmq::command_t::args_t::@27 attach
zmq::command_t::args_t::endpoint_pair
endpoint_uri_pair_t * endpoint_pair
Definition: command.hpp:167
zmq::command_t::done
@ done
Definition: command.hpp:49
zmq::command_t::args_t::socket
zmq::socket_base_t * socket
Definition: command.hpp:154
zmq::command_t::term
@ term
Definition: command.hpp:40
zmq::command_t::args_t::outbound_queue_count
uint64_t outbound_queue_count
Definition: command.hpp:174
zmq::command_t::args_t::inhwm
int inhwm
Definition: command.hpp:120
zmq::command_t::args_t::pipe
zmq::pipe_t * pipe
Definition: command.hpp:82
zmq::command_t::args_t::linger
int linger
Definition: command.hpp:134
zmq::command_t::args_t::hiccup
struct zmq::command_t::args_t::@31 hiccup
zmq::command_t::args_t::term_req
struct zmq::command_t::args_t::@35 term_req
zmq::command_t::args_t::term_endpoint
struct zmq::command_t::args_t::@38 term_endpoint
zmq::command_t::args_t::bind
struct zmq::command_t::args_t::@28 bind
zmq::command_t::activate_write
@ activate_write
Definition: command.hpp:34
zmq::command_t::term_ack
@ term_ack
Definition: command.hpp:41
zmq::command_t::args_t::socket_base
zmq::own_t * socket_base
Definition: command.hpp:166
zmq::command_t::type_t
type_t
Definition: command.hpp:26
zmq::command_t::own
@ own
Definition: command.hpp:30
zmq::command_t::args_t::own
struct zmq::command_t::args_t::@26 own
string
GLsizei const GLchar *const * string
Definition: glcorearb.h:3083
zmq::command_t::args_t::queue_count
uint64_t queue_count
Definition: command.hpp:165
zmq::command_t::pipe_term_ack
@ pipe_term_ack
Definition: command.hpp:37
zmq::command_t::args_t::plug
struct zmq::command_t::args_t::@25 plug
zmq::command_t::plug
@ plug
Definition: command.hpp:29
zmq::command_t::args_t::engine
struct i_engine * engine
Definition: command.hpp:75
zmq::socket_base_t
Definition: socket_base.hpp:31
zmq::command_t::args_t::object
zmq::own_t * object
Definition: command.hpp:68
zmq::command_t::args_t
Definition: command.hpp:52
zmq::command_t::bind
@ bind
Definition: command.hpp:32
zmq::command_t::attach
@ attach
Definition: command.hpp:31
zmq::command_t::args_t::done
struct zmq::command_t::args_t::@43 done
zmq
Definition: zmq.hpp:229
zmq::command_t::type
enum zmq::command_t::type_t type
zmq::command_t::args_t::msgs_read
uint64_t msgs_read
Definition: command.hpp:95
zmq::command_t::args_t::outhwm
int outhwm
Definition: command.hpp:121
zmq::endpoint_uri_pair_t
Definition: endpoint.hpp:17
zmq::command_t::pipe_term
@ pipe_term
Definition: command.hpp:36
zmq::command_t::args_t::reaped
struct zmq::command_t::args_t::@40 reaped
stdint.hpp
zmq::command_t::stop
@ stop
Definition: command.hpp:28
zmq::command_t::args_t::activate_read
struct zmq::command_t::args_t::@29 activate_read
zmq::command_t::args_t::stop
struct zmq::command_t::args_t::@24 stop
zmq::command_t::args_t::pipe
void * pipe
Definition: command.hpp:103
endpoint.hpp
zmq::command_t::reap
@ reap
Definition: command.hpp:43
zmq::command_t::args_t::inbound_queue_count
uint64_t inbound_queue_count
Definition: command.hpp:175
zmq::command_t::inproc_connected
@ inproc_connected
Definition: command.hpp:45
zmq::command_t::term_endpoint
@ term_endpoint
Definition: command.hpp:42
zmq::command_t::args_t::activate_write
struct zmq::command_t::args_t::@30 activate_write
zmq::command_t::reaped
@ reaped
Definition: command.hpp:44
zmq::command_t::args_t::term
struct zmq::command_t::args_t::@36 term
zmq::command_t::pipe_peer_stats
@ pipe_peer_stats
Definition: command.hpp:47
zmq::object_t
Definition: object.hpp:28
zmq::command_t::args_t::term_ack
struct zmq::command_t::args_t::@37 term_ack
zmq::command_t::args_t::pipe_term_ack
struct zmq::command_t::args_t::@33 pipe_term_ack
zmq::command_t::args_t::reap
struct zmq::command_t::args_t::@39 reap
zmq::command_t::activate_read
@ activate_read
Definition: command.hpp:33
zmq::command_t::args_t::pipe_hwm
struct zmq::command_t::args_t::@34 pipe_hwm
zmq::command_t::pipe_stats_publish
@ pipe_stats_publish
Definition: command.hpp:48
zmq::command_t::args_t::endpoint
std::string * endpoint
Definition: command.hpp:147
zmq::own_t
Definition: own.hpp:21
zmq::command_t::term_req
@ term_req
Definition: command.hpp:39
zmq::command_t::args_t::pipe_peer_stats
struct zmq::command_t::args_t::@41 pipe_peer_stats
zmq::command_t::args_t::pipe_stats_publish
struct zmq::command_t::args_t::@42 pipe_stats_publish
zmq::command_t::destination
zmq::object_t * destination
Definition: command.hpp:24
zmq::i_engine
Definition: i_engine.hpp:15
zmq::command_t::args_t::pipe_term
struct zmq::command_t::args_t::@32 pipe_term
zmq::command_t::hiccup
@ hiccup
Definition: command.hpp:35
zmq::command_t::args
union zmq::command_t::args_t args
zmq::command_t
Definition: command.hpp:21
zmq::command_t::pipe_hwm
@ pipe_hwm
Definition: command.hpp:38
zmq::command_t::conn_failed
@ conn_failed
Definition: command.hpp:46


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