conexus logo

Conexus::MessageQueue Class Reference
[Conexus I/O Endpoints]

This class encapsulates a POSIX message queue. More...

#include <messagequeue.h>

Inheritance diagram for Conexus::MessageQueue:

Inheritance graph
[legend]

List of all members.

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
}


Detailed Description

This class encapsulates a POSIX message queue.

Todo:
Drive message queues off notifications rather than the timeout mechanism of Endpoint
Author:
Rick L Vinyard Jr

Member Typedef Documentation


Constructor & Destructor Documentation

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.


Member Function Documentation

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]

unsigned Conexus::MessageQueue::flags (  )  const

References m_flags.

Referenced by open().

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]

Data Conexus::MessageQueue::read_data ( size_t  size,
Timeout  timeout 
) throw ( read_exception ) [protected, virtual]

void Conexus::MessageQueue::set_flags ( unsigned  flags  ) 

References m_flags.

void Conexus::MessageQueue::set_name ( const std::string &  name  ) 

Reimplemented from Conexus::Object.

References m_name.

void Conexus::MessageQueue::set_unlink_on_destruction ( bool  u = true  ) 

bool Conexus::MessageQueue::unlink_on_destruction (  ) 

size_t Conexus::MessageQueue::write_data ( const Data  data,
Timeout  timeout 
) throw ( write_exception ) [protected, virtual]


Friends And Related Function Documentation

enum QueueMode [related]

Enumerator:
QUEUE_READ 
QUEUE_WRITE 
QUEUE_CREATE 
QUEUE_EXCLUSIVE_CREATE 
QUEUE_NONBLOCKING 
QUEUE_UNCHANGED 


Member Data Documentation

unsigned Conexus::MessageQueue::m_flags [protected]

Referenced by flags(), open(), and set_flags().

Referenced by max_message_size(), and open().

Referenced by max_messages(), and open().

mode_t Conexus::MessageQueue::m_mode [protected]

Referenced by open().

std::string Conexus::MessageQueue::m_name [protected]

Reimplemented from Conexus::Object.

Referenced by name(), open(), set_name(), and ~MessageQueue().

mqd_t Conexus::MessageQueue::m_queue [protected]

Referenced by open().


The documentation for this class was generated from the following files:

Generated on Wed Jul 8 15:51:20 2009 for conexus by doxygen 1.5.8