![]() |
libzmq master
The Intelligent Transport Layer
|
#include <pipe.hpp>
Public Member Functions | |
bool | check_read () |
bool | check_write (msg_t *msg_) |
void | flush () |
int | get_array_index () |
int | get_array_index () |
int | get_array_index () |
ctx_t * | get_ctx () |
blob_t | get_identity () |
uint32_t | get_tid () |
void | hiccup () |
void | process_command (struct command_t &cmd_) |
bool | read (msg_t *msg_) |
void | rollback () |
void | set_array_index (int index_) |
void | set_array_index (int index_) |
void | set_array_index (int index_) |
void | set_event_sink (i_pipe_events *sink_) |
void | set_identity (const blob_t &identity_) |
void | terminate (bool delay_) |
bool | write (msg_t *msg_) |
Protected Member Functions | |
class io_thread_t * | choose_io_thread (uint64_t affinity_) |
void | destroy_socket (class socket_base_t *socket_) |
struct endpoint_t | find_endpoint (const char *addr_) |
void | log (const char *format_,...) |
virtual void | process_attach (struct i_engine *engine_) |
virtual void | process_bind (class pipe_t *pipe_) |
virtual void | process_own (class own_t *object_) |
virtual void | process_plug () |
virtual void | process_reap (class socket_base_t *socket_) |
virtual void | process_reaped () |
virtual void | process_seqnum () |
virtual void | process_stop () |
virtual void | process_term (int linger_) |
virtual void | process_term_ack () |
virtual void | process_term_req (class own_t *object_) |
int | register_endpoint (const char *addr_, struct endpoint_t &endpoint_) |
void | send_activate_read (class pipe_t *destination_) |
void | send_activate_write (class pipe_t *destination_, uint64_t msgs_read_) |
void | send_attach (class session_base_t *destination_, struct i_engine *engine_, bool inc_seqnum_=true) |
void | send_bind (class own_t *destination_, class pipe_t *pipe_, bool inc_seqnum_=true) |
void | send_done () |
void | send_hiccup (class pipe_t *destination_, void *pipe_) |
void | send_own (class own_t *destination_, class own_t *object_) |
void | send_pipe_term (class pipe_t *destination_) |
void | send_pipe_term_ack (class pipe_t *destination_) |
void | send_plug (class own_t *destination_, bool inc_seqnum_=true) |
void | send_reap (class socket_base_t *socket_) |
void | send_reaped () |
void | send_stop () |
void | send_term (class own_t *destination_, int linger_) |
void | send_term_ack (class own_t *destination_) |
void | send_term_req (class own_t *destination_, class own_t *object_) |
void | unregister_endpoints (class socket_base_t *socket_) |
Private Types | |
enum | { active, delimited, pending, terminating, terminated, double_terminated } |
typedef ypipe_t< msg_t, message_pipe_granularity > | upipe_t |
Private Member Functions | |
pipe_t (object_t *parent_, upipe_t *inpipe_, upipe_t *outpipe_, int inhwm_, int outhwm_, bool delay_) | |
pipe_t (const pipe_t &) | |
~pipe_t () | |
void | delimit () |
const pipe_t & | operator= (const pipe_t &) |
void | process_activate_read () |
void | process_activate_write (uint64_t msgs_read_) |
void | process_hiccup (void *pipe_) |
void | process_pipe_term () |
void | process_pipe_term_ack () |
void | set_peer (pipe_t *pipe_) |
Static Private Member Functions | |
static int | compute_lwm (int hwm_) |
static bool | is_delimiter (msg_t &msg_) |
Private Attributes | |
bool | delay |
int | hwm |
blob_t | identity |
bool | in_active |
upipe_t * | inpipe |
int | lwm |
uint64_t | msgs_read |
uint64_t | msgs_written |
bool | out_active |
upipe_t * | outpipe |
pipe_t * | peer |
uint64_t | peers_msgs_read |
i_pipe_events * | sink |
enum zmq::pipe_t:: { ... } | state |
Friends | |
int | pipepair (class object_t *parents_[2], class pipe_t *pipes_[2], int hwms_[2], bool delays_[2]) |
typedef ypipe_t<msg_t, message_pipe_granularity> zmq::pipe_t::upipe_t [private] |
anonymous enum [private] |
zmq::pipe_t::pipe_t | ( | const pipe_t & | ) | [private] |
bool zmq::pipe_t::check_read | ( | ) |
Definition at line 100 of file pipe.cpp.
References unlikely, and zmq_assert.
bool zmq::pipe_t::check_write | ( | msg_t * | msg_ | ) |
zmq::io_thread_t * zmq::object_t::choose_io_thread | ( | uint64_t | affinity_ | ) | [protected, inherited] |
Definition at line 160 of file object.cpp.
References zmq::object_t::choose_io_thread().
Referenced by zmq::object_t::choose_io_thread().
void zmq::pipe_t::delimit | ( | ) | [private] |
Definition at line 419 of file pipe.cpp.
References zmq_assert.
void zmq::object_t::destroy_socket | ( | class socket_base_t * | socket_ | ) | [protected, inherited] |
Definition at line 147 of file object.cpp.
zmq::endpoint_t zmq::object_t::find_endpoint | ( | const char * | addr_ | ) | [read, protected, inherited] |
Definition at line 142 of file object.cpp.
void zmq::pipe_t::flush | ( | ) |
Definition at line 190 of file pipe.cpp.
Referenced by zmq::dist_t::write(), zmq::xsub_t::xattach_pipe(), and zmq::xsub_t::xhiccuped().
int zmq::array_item_t< ID >::get_array_index | ( | ) | [inline, inherited] |
int zmq::array_item_t< ID >::get_array_index | ( | ) | [inline, inherited] |
int zmq::array_item_t< ID >::get_array_index | ( | ) | [inline, inherited] |
Definition at line 56 of file array.hpp.
References zmq::array_item_t< ID >::array_index.
zmq::ctx_t * zmq::object_t::get_ctx | ( | ) | [inherited] |
Definition at line 54 of file object.cpp.
zmq::blob_t zmq::pipe_t::get_identity | ( | ) |
Definition at line 95 of file pipe.cpp.
Referenced by zmq::xrep_t::xrecv().
uint32_t zmq::object_t::get_tid | ( | ) | [inherited] |
Definition at line 49 of file object.cpp.
Referenced by zmq::ctx_t::destroy_socket(), and zmq::object_t::send_command().
void zmq::pipe_t::hiccup | ( | ) |
Definition at line 437 of file pipe.cpp.
References alloc_assert.
bool zmq::pipe_t::is_delimiter | ( | msg_t & | msg_ | ) | [static, private] |
Definition at line 386 of file pipe.cpp.
References zmq::msg_t::is_delimiter().
void zmq::object_t::log | ( | const char * | format_, |
... | |||
) | [protected, inherited] |
Definition at line 152 of file object.cpp.
void zmq::pipe_t::process_activate_read | ( | ) | [private, virtual] |
Reimplemented from zmq::object_t.
void zmq::pipe_t::process_activate_write | ( | uint64_t | msgs_read_ | ) | [private, virtual] |
Reimplemented from zmq::object_t.
void zmq::object_t::process_attach | ( | struct i_engine * | engine_ | ) | [protected, virtual, inherited] |
Reimplemented in zmq::session_base_t.
Definition at line 380 of file object.cpp.
References zmq_assert.
void zmq::object_t::process_bind | ( | class pipe_t * | pipe_ | ) | [protected, virtual, inherited] |
Reimplemented in zmq::socket_base_t.
Definition at line 385 of file object.cpp.
References zmq_assert.
void zmq::object_t::process_command | ( | struct command_t & | cmd_ | ) | [inherited] |
Definition at line 59 of file object.cpp.
References zmq::command_t::activate_read, zmq::command_t::activate_write, zmq::command_t::args, zmq::command_t::attach, zmq::command_t::bind, zmq::command_t::hiccup, zmq::command_t::own, zmq::command_t::pipe_term, zmq::command_t::pipe_term_ack, zmq::command_t::plug, zmq::command_t::reap, zmq::command_t::reaped, zmq::command_t::stop, zmq::command_t::term, zmq::command_t::term_ack, zmq::command_t::term_req, zmq::command_t::type, and zmq_assert.
Referenced by zmq::reaper_t::in_event(), zmq::io_thread_t::in_event(), and zmq::socket_base_t::process_commands().
void zmq::pipe_t::process_hiccup | ( | void * | pipe_ | ) | [private, virtual] |
Reimplemented from zmq::object_t.
Definition at line 223 of file pipe.cpp.
References zmq::msg_t::close(), errno_assert, and zmq_assert.
void zmq::object_t::process_own | ( | class own_t * | object_ | ) | [protected, virtual, inherited] |
void zmq::pipe_t::process_pipe_term | ( | ) | [private, virtual] |
void zmq::pipe_t::process_pipe_term_ack | ( | ) | [private, virtual] |
Reimplemented from zmq::object_t.
Definition at line 289 of file pipe.cpp.
References zmq::msg_t::close(), errno_assert, and zmq_assert.
void zmq::object_t::process_plug | ( | ) | [protected, virtual, inherited] |
Reimplemented in zmq::ipc_connecter_t, zmq::ipc_listener_t, zmq::session_base_t, zmq::tcp_connecter_t, and zmq::tcp_listener_t.
Definition at line 370 of file object.cpp.
References zmq_assert.
void zmq::object_t::process_reap | ( | class socket_base_t * | socket_ | ) | [protected, virtual, inherited] |
void zmq::object_t::process_reaped | ( | ) | [protected, virtual, inherited] |
void zmq::object_t::process_seqnum | ( | ) | [protected, virtual, inherited] |
void zmq::object_t::process_stop | ( | ) | [protected, virtual, inherited] |
Reimplemented in zmq::io_thread_t, zmq::reaper_t, and zmq::socket_base_t.
Definition at line 365 of file object.cpp.
References zmq_assert.
void zmq::object_t::process_term | ( | int | linger_ | ) | [protected, virtual, inherited] |
Reimplemented in zmq::ipc_listener_t, zmq::own_t, zmq::session_base_t, zmq::socket_base_t, and zmq::tcp_listener_t.
Definition at line 420 of file object.cpp.
References zmq_assert.
void zmq::object_t::process_term_ack | ( | ) | [protected, virtual, inherited] |
void zmq::object_t::process_term_req | ( | class own_t * | object_ | ) | [protected, virtual, inherited] |
bool zmq::pipe_t::read | ( | msg_t * | msg_ | ) |
Definition at line 124 of file pipe.cpp.
References zmq::msg_t::flags, zmq::msg_t::is_delimiter(), zmq::msg_t::more, and unlikely.
Referenced by zmq::xpub_t::xread_activated().
int zmq::object_t::register_endpoint | ( | const char * | addr_, |
struct endpoint_t & | endpoint_ | ||
) | [protected, inherited] |
Definition at line 132 of file object.cpp.
void zmq::pipe_t::rollback | ( | ) |
Definition at line 177 of file pipe.cpp.
References zmq::msg_t::close(), errno_assert, zmq::msg_t::flags, zmq::msg_t::more, and zmq_assert.
void zmq::object_t::send_activate_read | ( | class pipe_t * | destination_ | ) | [protected, inherited] |
Definition at line 237 of file object.cpp.
References zmq::command_t::activate_read, zmq::command_t::destination, and zmq::command_t::type.
void zmq::object_t::send_activate_write | ( | class pipe_t * | destination_, |
uint64_t | msgs_read_ | ||
) | [protected, inherited] |
Definition at line 248 of file object.cpp.
References zmq::command_t::activate_write, zmq::command_t::args, zmq::command_t::destination, and zmq::command_t::type.
void zmq::object_t::send_attach | ( | class session_base_t * | destination_, |
struct i_engine * | engine_, | ||
bool | inc_seqnum_ = true |
||
) | [protected, inherited] |
Definition at line 205 of file object.cpp.
References zmq::command_t::args, zmq::command_t::attach, zmq::command_t::destination, zmq::own_t::inc_seqnum(), and zmq::command_t::type.
void zmq::object_t::send_bind | ( | class own_t * | destination_, |
class pipe_t * | pipe_, | ||
bool | inc_seqnum_ = true |
||
) | [protected, inherited] |
Definition at line 221 of file object.cpp.
References zmq::command_t::args, zmq::command_t::bind, zmq::command_t::destination, zmq::own_t::inc_seqnum(), and zmq::command_t::type.
void zmq::object_t::send_done | ( | ) | [protected, inherited] |
Definition at line 354 of file object.cpp.
References zmq::command_t::destination, zmq::command_t::done, zmq::ctx_t::term_tid, and zmq::command_t::type.
void zmq::object_t::send_hiccup | ( | class pipe_t * | destination_, |
void * | pipe_ | ||
) | [protected, inherited] |
Definition at line 261 of file object.cpp.
References zmq::command_t::args, zmq::command_t::destination, zmq::command_t::hiccup, and zmq::command_t::type.
void zmq::object_t::send_own | ( | class own_t * | destination_, |
class own_t * | object_ | ||
) | [protected, inherited] |
Definition at line 192 of file object.cpp.
References zmq::command_t::args, zmq::command_t::destination, zmq::own_t::inc_seqnum(), zmq::command_t::own, and zmq::command_t::type.
void zmq::object_t::send_pipe_term | ( | class pipe_t * | destination_ | ) | [protected, inherited] |
Definition at line 273 of file object.cpp.
References zmq::command_t::destination, zmq::command_t::pipe_term, and zmq::command_t::type.
void zmq::object_t::send_pipe_term_ack | ( | class pipe_t * | destination_ | ) | [protected, inherited] |
Definition at line 284 of file object.cpp.
References zmq::command_t::destination, zmq::command_t::pipe_term_ack, and zmq::command_t::type.
void zmq::object_t::send_plug | ( | class own_t * | destination_, |
bool | inc_seqnum_ = true |
||
) | [protected, inherited] |
Definition at line 178 of file object.cpp.
References zmq::command_t::destination, zmq::own_t::inc_seqnum(), zmq::command_t::plug, and zmq::command_t::type.
void zmq::object_t::send_reap | ( | class socket_base_t * | socket_ | ) | [protected, inherited] |
Definition at line 331 of file object.cpp.
References zmq::command_t::args, zmq::command_t::destination, zmq::command_t::reap, and zmq::command_t::type.
void zmq::object_t::send_reaped | ( | ) | [protected, inherited] |
Definition at line 343 of file object.cpp.
References zmq::command_t::destination, zmq::command_t::reaped, and zmq::command_t::type.
void zmq::object_t::send_stop | ( | ) | [protected, inherited] |
Definition at line 165 of file object.cpp.
References zmq::command_t::destination, zmq::command_t::stop, and zmq::command_t::type.
void zmq::object_t::send_term | ( | class own_t * | destination_, |
int | linger_ | ||
) | [protected, inherited] |
Definition at line 308 of file object.cpp.
References zmq::command_t::args, zmq::command_t::destination, zmq::command_t::term, and zmq::command_t::type.
void zmq::object_t::send_term_ack | ( | class own_t * | destination_ | ) | [protected, inherited] |
Definition at line 320 of file object.cpp.
References zmq::command_t::destination, zmq::command_t::term_ack, and zmq::command_t::type.
void zmq::object_t::send_term_req | ( | class own_t * | destination_, |
class own_t * | object_ | ||
) | [protected, inherited] |
Definition at line 295 of file object.cpp.
References zmq::command_t::args, zmq::command_t::destination, zmq::command_t::term_req, and zmq::command_t::type.
void zmq::array_item_t< ID >::set_array_index | ( | int | index_ | ) | [inline, inherited] |
void zmq::array_item_t< ID >::set_array_index | ( | int | index_ | ) | [inline, inherited] |
void zmq::array_item_t< ID >::set_array_index | ( | int | index_ | ) | [inline, inherited] |
Definition at line 51 of file array.hpp.
References zmq::array_item_t< ID >::array_index.
void zmq::pipe_t::set_event_sink | ( | i_pipe_events * | sink_ | ) |
Definition at line 83 of file pipe.cpp.
References zmq_assert.
Referenced by zmq::socket_base_t::attach_pipe(), zmq::session_base_t::attach_pipe(), and zmq::session_base_t::process_attach().
void zmq::pipe_t::set_identity | ( | const blob_t & | identity_ | ) |
Definition at line 90 of file pipe.cpp.
Referenced by zmq::xrep_t::xattach_pipe(), and zmq::xrep_t::xrecv().
void zmq::pipe_t::set_peer | ( | pipe_t * | pipe_ | ) | [private] |
Definition at line 76 of file pipe.cpp.
References zmq_assert.
void zmq::pipe_t::terminate | ( | bool | delay_ | ) |
Definition at line 324 of file pipe.cpp.
References zmq::msg_t::init_delimiter(), and zmq_assert.
Referenced by zmq::socket_base_t::attach_pipe().
void zmq::object_t::unregister_endpoints | ( | class socket_base_t * | socket_ | ) | [protected, inherited] |
Definition at line 137 of file object.cpp.
bool zmq::pipe_t::write | ( | msg_t * | msg_ | ) |
Definition at line 164 of file pipe.cpp.
References zmq::msg_t::flags, zmq::msg_t::more, and unlikely.
Referenced by zmq::socket_base_t::connect(), zmq::xsub_t::send_subscription(), and zmq::dist_t::write().
int pipepair | ( | class object_t * | parents_[2], |
class pipe_t * | pipes_[2], | ||
int | hwms_[2], | ||
bool | delays_[2] | ||
) | [friend] |
bool zmq::pipe_t::delay [private] |
int zmq::pipe_t::hwm [private] |
blob_t zmq::pipe_t::identity [private] |
bool zmq::pipe_t::in_active [private] |
upipe_t* zmq::pipe_t::inpipe [private] |
int zmq::pipe_t::lwm [private] |
uint64_t zmq::pipe_t::msgs_read [private] |
uint64_t zmq::pipe_t::msgs_written [private] |
bool zmq::pipe_t::out_active [private] |
upipe_t* zmq::pipe_t::outpipe [private] |
pipe_t* zmq::pipe_t::peer [private] |
uint64_t zmq::pipe_t::peers_msgs_read [private] |
i_pipe_events* zmq::pipe_t::sink [private] |
enum { ... } zmq::pipe_t::state [private] |