#include <messagequeue.h>
Public Types | |
typedef ConexusPointer < MessageQueue > | pointer |
Public Member Functions | |
CONEXUS_ENDPOINT_GENERIC_CREATE () | |
virtual | ~MessageQueue () |
virtual void | open () throw ( open_exception ) |
virtual void | close (bool force=false) throw ( close_exception ) |
const std::string & | name () const |
void | set_name (const std::string &name) |
unsigned | flags () const |
void | set_flags (unsigned flags) |
bool | unlink_on_destruction () |
void | set_unlink_on_destruction (bool u=true) |
long int | max_messages () |
long int | max_message_size () |
Static Public Member Functions | |
static MessageQueue::pointer | create (const std::string &name=std::string(), unsigned flags=QUEUE_READ|QUEUE_WRITE|QUEUE_CREATE, mode_t mode=S_IRWXU, bool close_on_destruct=true) |
Protected Member Functions | |
MessageQueue (const std::string &name, unsigned flags, mode_t mode, bool close_on_destruct) | |
virtual size_t | write_data (const Data data, Timeout timeout) throw ( write_exception ) |
virtual Data | read_data (size_t size, Timeout timeout) throw ( read_exception ) |
Protected Attributes | |
std::string | m_name |
unsigned | m_flags |
bool | m_unlink_on_destruction |
long int | m_max_messages |
long int | m_max_message_size |
mode_t | m_mode |
mqd_t | m_queue |
Related Functions | |
(Note that these are not member functions.) | |
enum | QueueMode { QUEUE_READ = 1<<0, QUEUE_WRITE = 1<<1, QUEUE_CREATE = 1<<2, QUEUE_EXCLUSIVE_CREATE = 1<<3, QUEUE_NONBLOCKING = 1<<4, QUEUE_UNCHANGED = 1<<5 } |
typedef ConexusPointer<MessageQueue> Conexus::MessageQueue::pointer |
Reimplemented from Conexus::Endpoint.
Conexus::MessageQueue::MessageQueue | ( | const std::string & | name, | |
unsigned | flags, | |||
mode_t | mode, | |||
bool | close_on_destruct | |||
) | [protected] |
Conexus::MessageQueue::~MessageQueue | ( | ) | [virtual] |
References m_name, and m_unlink_on_destruction.
void Conexus::MessageQueue::close | ( | bool | force = false |
) | throw ( close_exception ) [virtual] |
Conexus::MessageQueue::CONEXUS_ENDPOINT_GENERIC_CREATE | ( | ) |
MessageQueue::pointer Conexus::MessageQueue::create | ( | const std::string & | name = std::string() , |
|
unsigned | flags = QUEUE_READ|QUEUE_WRITE|QUEUE_CREATE , |
|||
mode_t | mode = S_IRWXU , |
|||
bool | close_on_destruct = true | |||
) | [static] |
long int Conexus::MessageQueue::max_message_size | ( | ) |
References m_max_message_size.
long int Conexus::MessageQueue::max_messages | ( | ) |
References m_max_messages.
const std::string & Conexus::MessageQueue::name | ( | ) | const |
References m_name.
void Conexus::MessageQueue::open | ( | ) | throw ( open_exception ) [virtual] |
Implements Conexus::Endpoint.
References flags(), m_flags, m_max_message_size, m_max_messages, m_mode, m_name, m_queue, Conexus::QUEUE_CREATE, Conexus::QUEUE_EXCLUSIVE_CREATE, Conexus::QUEUE_NONBLOCKING, Conexus::QUEUE_READ, Conexus::QUEUE_WRITE, Conexus::Endpoint::set_state_opened(), and Conexus::throw_open_exception().
Data Conexus::MessageQueue::read_data | ( | size_t | size, | |
Timeout | timeout | |||
) | throw ( read_exception ) [protected, virtual] |
Implements Conexus::Endpoint.
References Conexus::Data::resize(), Conexus::Data::set_current_time(), Conexus::Data::size(), and Conexus::throw_read_exception().
void Conexus::MessageQueue::set_flags | ( | unsigned | flags | ) |
References m_flags.
void Conexus::MessageQueue::set_name | ( | const std::string & | name | ) |
void Conexus::MessageQueue::set_unlink_on_destruction | ( | bool | u = true |
) |
References m_unlink_on_destruction.
bool Conexus::MessageQueue::unlink_on_destruction | ( | ) |
References m_unlink_on_destruction.
size_t Conexus::MessageQueue::write_data | ( | const Data | data, | |
Timeout | timeout | |||
) | throw ( write_exception ) [protected, virtual] |
enum QueueMode [related] |
unsigned Conexus::MessageQueue::m_flags [protected] |
Referenced by flags(), open(), and set_flags().
long int Conexus::MessageQueue::m_max_message_size [protected] |
Referenced by max_message_size(), and open().
long int Conexus::MessageQueue::m_max_messages [protected] |
Referenced by max_messages(), and open().
mode_t Conexus::MessageQueue::m_mode [protected] |
Referenced by open().
std::string Conexus::MessageQueue::m_name [protected] |
mqd_t Conexus::MessageQueue::m_queue [protected] |
Referenced by open().
bool Conexus::MessageQueue::m_unlink_on_destruction [protected] |
Referenced by set_unlink_on_destruction(), unlink_on_destruction(), and ~MessageQueue().