![]() |
libzmq master
The Intelligent Transport Layer
|
#include <ctx.hpp>
Public Types | |
enum | { term_tid = 0, reaper_tid = 1 } |
Public Member Functions | |
ctx_t (uint32_t io_threads_) | |
bool | check_tag () |
class io_thread_t * | choose_io_thread (uint64_t affinity_) |
class socket_base_t * | create_socket (int type_) |
void | destroy_socket (class socket_base_t *socket_) |
endpoint_t | find_endpoint (const char *addr_) |
class object_t * | get_reaper () |
void | log (const char *format_, va_list args_) |
int | register_endpoint (const char *addr_, endpoint_t &endpoint_) |
void | send_command (uint32_t tid_, const command_t &command_) |
int | terminate () |
void | unregister_endpoints (class socket_base_t *socket_) |
Private Types | |
typedef std::vector< uint32_t > | emtpy_slots_t |
typedef std::map< std::string, endpoint_t > | endpoints_t |
typedef std::vector< class io_thread_t * > | io_threads_t |
typedef array_t< socket_base_t > | sockets_t |
Private Member Functions | |
ctx_t (const ctx_t &) | |
~ctx_t () | |
const ctx_t & | operator= (const ctx_t &) |
Private Attributes | |
emtpy_slots_t | empty_slots |
endpoints_t | endpoints |
mutex_t | endpoints_sync |
io_threads_t | io_threads |
class socket_base_t * | log_socket |
mutex_t | log_sync |
class reaper_t * | reaper |
uint32_t | slot_count |
mutex_t | slot_sync |
mailbox_t ** | slots |
sockets_t | sockets |
uint32_t | tag |
mailbox_t | term_mailbox |
bool | terminating |
typedef std::vector<uint32_t> zmq::ctx_t::emtpy_slots_t [private] |
typedef std::map<std::string, endpoint_t> zmq::ctx_t::endpoints_t [private] |
typedef std::vector<class io_thread_t*> zmq::ctx_t::io_threads_t [private] |
typedef array_t<socket_base_t> zmq::ctx_t::sockets_t [private] |
zmq::ctx_t::ctx_t | ( | uint32_t | io_threads_ | ) |
Definition at line 40 of file ctx.cpp.
References alloc_assert, zmq::socket_base_t::bind(), create_socket(), empty_slots, zmq::io_thread_t::get_mailbox(), zmq::reaper_t::get_mailbox(), io_threads, log_socket, reaper, reaper_tid, slot_count, slots, zmq::io_thread_t::start(), zmq::reaper_t::start(), term_mailbox, term_tid, zmq_assert, and ZMQ_PUB.
zmq::ctx_t::~ctx_t | ( | ) | [private] |
Definition at line 89 of file ctx.cpp.
References zmq_assert.
zmq::ctx_t::ctx_t | ( | const ctx_t & | ) | [private] |
zmq::io_thread_t * zmq::ctx_t::choose_io_thread | ( | uint64_t | affinity_ | ) |
Definition at line 228 of file ctx.cpp.
References zmq::io_thread_t::get_load(), and zmq_assert.
zmq::socket_base_t * zmq::ctx_t::create_socket | ( | int | type_ | ) |
Definition at line 161 of file ctx.cpp.
References zmq::socket_base_t::create(), ETERM, and zmq::socket_base_t::get_mailbox().
Referenced by ctx_t().
void zmq::ctx_t::destroy_socket | ( | class socket_base_t * | socket_ | ) |
Definition at line 198 of file ctx.cpp.
References zmq::object_t::get_tid().
zmq::endpoint_t zmq::ctx_t::find_endpoint | ( | const char * | addr_ | ) |
Definition at line 283 of file ctx.cpp.
References ECONNREFUSED, zmq::own_t::inc_seqnum(), and zmq::endpoint_t::socket.
zmq::object_t * zmq::ctx_t::get_reaper | ( | ) |
void zmq::ctx_t::log | ( | const char * | format_, |
va_list | args_ | ||
) |
Definition at line 306 of file ctx.cpp.
References zmq::msg_t::close(), zmq::msg_t::data, errno_assert, zmq::msg_t::init_size(), and zmq::msg_t::size.
int zmq::ctx_t::register_endpoint | ( | const char * | addr_, |
endpoint_t & | endpoint_ | ||
) |
Definition at line 249 of file ctx.cpp.
References EADDRINUSE.
void zmq::ctx_t::send_command | ( | uint32_t | tid_, |
const command_t & | command_ | ||
) |
int zmq::ctx_t::terminate | ( | ) |
Definition at line 115 of file ctx.cpp.
References zmq::command_t::done, zmq::command_t::type, and zmq_assert.
void zmq::ctx_t::unregister_endpoints | ( | class socket_base_t * | socket_ | ) |
emtpy_slots_t zmq::ctx_t::empty_slots [private] |
endpoints_t zmq::ctx_t::endpoints [private] |
mutex_t zmq::ctx_t::endpoints_sync [private] |
io_threads_t zmq::ctx_t::io_threads [private] |
class socket_base_t* zmq::ctx_t::log_socket [private] |
mutex_t zmq::ctx_t::log_sync [private] |
class reaper_t* zmq::ctx_t::reaper [private] |
uint32_t zmq::ctx_t::slot_count [private] |
mutex_t zmq::ctx_t::slot_sync [private] |
mailbox_t** zmq::ctx_t::slots [private] |
sockets_t zmq::ctx_t::sockets [private] |
uint32_t zmq::ctx_t::tag [private] |
mailbox_t zmq::ctx_t::term_mailbox [private] |
bool zmq::ctx_t::terminating [private] |