libzmq  master
ZeroMQ C++ Core Engine (LIBZMQ)
zmq::mailbox_t Class Reference

#include <mailbox.hpp>

Inheritance diagram for zmq::mailbox_t:
Collaboration diagram for zmq::mailbox_t:

Public Member Functions

 mailbox_t ()
 
 ~mailbox_t ()
 
fd_t get_fd () const
 
int recv (command_t *cmd_, int timeout_)
 
void send (const command_t &cmd_)
 
- Public Member Functions inherited from zmq::i_mailbox
virtual ~i_mailbox ()
 

Private Types

typedef ypipe_t< command_t, command_pipe_granularitycpipe_t
 

Private Member Functions

 mailbox_t (const mailbox_t &)
 
const mailbox_toperator= (const mailbox_t &)
 

Private Attributes

bool active
 
cpipe_t cpipe
 
signaler_t signaler
 
mutex_t sync
 

Detailed Description

Definition at line 47 of file mailbox.hpp.

Member Typedef Documentation

Definition at line 68 of file mailbox.hpp.

Constructor & Destructor Documentation

zmq::mailbox_t::mailbox_t ( )

Definition at line 34 of file mailbox.cpp.

References active, cpipe, zmq::ypipe_t< T, N >::read(), and zmq_assert.

Here is the call graph for this function:

zmq::mailbox_t::~mailbox_t ( )

Definition at line 44 of file mailbox.cpp.

References zmq::mutex_t::lock(), sync, and zmq::mutex_t::unlock().

Here is the call graph for this function:

zmq::mailbox_t::mailbox_t ( const mailbox_t )
private

Member Function Documentation

zmq::fd_t zmq::mailbox_t::get_fd ( ) const

Definition at line 54 of file mailbox.cpp.

References zmq::signaler_t::get_fd(), and signaler.

Referenced by zmq::io_thread_t::io_thread_t(), zmq::reaper_t::reaper_t(), and zmq::socket_base_t::socket_base_t().

Here is the call graph for this function:

Here is the caller graph for this function:

const mailbox_t& zmq::mailbox_t::operator= ( const mailbox_t )
private
int zmq::mailbox_t::recv ( command_t cmd_,
int  timeout_ 
)
virtual

Implements zmq::i_mailbox.

Definition at line 69 of file mailbox.cpp.

References active, cpipe, errno_assert, zmq::ypipe_t< T, N >::read(), zmq::signaler_t::recv_failable(), signaler, zmq::signaler_t::wait(), and zmq_assert.

Referenced by zmq::reaper_t::in_event(), zmq::io_thread_t::in_event(), and zmq::ctx_t::terminate().

Here is the call graph for this function:

Here is the caller graph for this function:

void zmq::mailbox_t::send ( const command_t cmd_)
virtual

Implements zmq::i_mailbox.

Definition at line 59 of file mailbox.cpp.

References cpipe, zmq::ypipe_t< T, N >::flush(), zmq::mutex_t::lock(), zmq::signaler_t::send(), signaler, sync, zmq::mutex_t::unlock(), and zmq::ypipe_t< T, N >::write().

Here is the call graph for this function:

Member Data Documentation

bool zmq::mailbox_t::active
private

Definition at line 82 of file mailbox.hpp.

Referenced by mailbox_t(), and recv().

cpipe_t zmq::mailbox_t::cpipe
private

Definition at line 69 of file mailbox.hpp.

Referenced by mailbox_t(), recv(), and send().

signaler_t zmq::mailbox_t::signaler
private

Definition at line 72 of file mailbox.hpp.

Referenced by get_fd(), recv(), and send().

mutex_t zmq::mailbox_t::sync
private

Definition at line 78 of file mailbox.hpp.

Referenced by send(), and ~mailbox_t().