Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

ACE_SV_Message_Queue Class Reference

Defines the header file for the C++ wrapper for System V IPC message queues. More...

#include <SV_Message_Queue.h>

List of all members.

Public Types

enum  { ACE_CREATE = IPC_CREAT, ACE_OPEN = 0, ACE_NOWAIT = IPC_NOWAIT }

Public Methods

 ACE_SV_Message_Queue (void)
 Open a message queue using the <external_id>. More...

 ACE_SV_Message_Queue (key_t external_id, int create=ACE_SV_Message_Queue::ACE_OPEN, int perms=ACE_DEFAULT_FILE_PERMS)
int open (key_t external_id, int create=ACE_SV_Message_Queue::ACE_OPEN, int perms=ACE_DEFAULT_FILE_PERMS)
 ~ACE_SV_Message_Queue (void)
int close (void)
 Close down this instance of the message queue without removing it from the system. More...

int remove (void)
 Close down and remove the message queue from the system. More...

int recv (ACE_SV_Message &mb, int length, long mtype=0, int mflags=0)
int send (const ACE_SV_Message &mb, int length, int mflags=0)
int control (int option, void *arg=0)
 Access the underlying control operations. More...

int get_id (void) const
 Get the underly internal id. More...

void set_id (int)
 Set the underly internal id. More...

void dump (void) const
 Dump the state of an object. More...


Public Attributes

 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks. More...


Protected Attributes

int internal_id_
 Returned from the underlying <msgget> system call. More...


Detailed Description

Defines the header file for the C++ wrapper for System V IPC message queues.

Definition at line 32 of file SV_Message_Queue.h.


Member Enumeration Documentation

anonymous enum
 

Enumeration values:
ACE_CREATE 
ACE_OPEN 
ACE_NOWAIT 

Definition at line 36 of file SV_Message_Queue.h.

00037   {
00038     ACE_CREATE = IPC_CREAT,
00039     ACE_OPEN   = 0,
00040     ACE_NOWAIT = IPC_NOWAIT
00041   };


Constructor & Destructor Documentation

ACE_SV_Message_Queue::ACE_SV_Message_Queue void   
 

Open a message queue using the <external_id>.

Definition at line 22 of file SV_Message_Queue.cpp.

References ACE_TRACE.

00023 {
00024   ACE_TRACE ("ACE_SV_Message_Queue::ACE_SV_Message_Queue");
00025 }

ACE_SV_Message_Queue::ACE_SV_Message_Queue key_t    external_id,
int    create = ACE_SV_Message_Queue::ACE_OPEN,
int    perms = ACE_DEFAULT_FILE_PERMS
 

Definition at line 32 of file SV_Message_Queue.cpp.

References ACE_ERROR, ACE_LIB_TEXT, ACE_TRACE, LM_ERROR, and open.

00035 {
00036   ACE_TRACE ("ACE_SV_Message_Queue::ACE_SV_Message_Queue");
00037   if (this->open (external_id, create, perms) == -1)
00038     ACE_ERROR ((LM_ERROR, ACE_LIB_TEXT ("%p\n"),
00039                 ACE_LIB_TEXT ("ACE_SV_Message_Queue::ACE_SV_Message_Queue")));
00040 }

ACE_SV_Message_Queue::~ACE_SV_Message_Queue void   
 

Definition at line 27 of file SV_Message_Queue.cpp.

References ACE_TRACE.

00028 {
00029   ACE_TRACE ("ACE_SV_Message_Queue::~ACE_SV_Message_Queue");
00030 }


Member Function Documentation

ASYS_INLINE int ACE_SV_Message_Queue::close void   
 

Close down this instance of the message queue without removing it from the system.

Definition at line 20 of file SV_Message_Queue.i.

References ACE_TRACE, and internal_id_.

00021 {
00022   ACE_TRACE ("ACE_SV_Message_Queue::close");
00023   this->internal_id_ = -1;
00024   return 1;
00025 }

ASYS_INLINE int ACE_SV_Message_Queue::control int    option,
void *    arg = 0
 

Access the underlying control operations.

Definition at line 28 of file SV_Message_Queue.i.

References ACE_TRACE, and ACE_OS::msgctl.

Referenced by ACE_Typed_SV_Message_Queue::control, and remove.

00029 {
00030   ACE_TRACE ("ACE_SV_Message_Queue::control");
00031   return ACE_OS::msgctl (this->internal_id_, option, 
00032                          (msqid_ds *) arg);
00033 }

void ACE_SV_Message_Queue::dump void    const
 

Dump the state of an object.

Definition at line 17 of file SV_Message_Queue.cpp.

References ACE_TRACE.

00018 {
00019   ACE_TRACE ("ACE_SV_Message_Queue::dump");
00020 }

ASYS_INLINE int ACE_SV_Message_Queue::get_id void    const
 

Get the underly internal id.

Definition at line 45 of file SV_Message_Queue.i.

References ACE_TRACE, and internal_id_.

Referenced by ACE_Typed_SV_Message_Queue::get_id.

00046 {
00047   ACE_TRACE ("ACE_SV_Message_Queue::get_id");
00048   return this->internal_id_;
00049 }

ASYS_INLINE int ACE_SV_Message_Queue::open key_t    external_id,
int    create = ACE_SV_Message_Queue::ACE_OPEN,
int    perms = ACE_DEFAULT_FILE_PERMS
 

Definition at line 11 of file SV_Message_Queue.i.

References ACE_TRACE, internal_id_, and ACE_OS::msgget.

Referenced by ACE_SV_Message_Queue, and ACE_Typed_SV_Message_Queue::open.

00012 {
00013   ACE_TRACE ("ACE_SV_Message_Queue::open");
00014   return this->internal_id_ = ACE_OS::msgget (external_id, create | perms);
00015 }

ASYS_INLINE int ACE_SV_Message_Queue::recv ACE_SV_Message   mb,
int    length,
long    mtype = 0,
int    mflags = 0
 

Definition at line 59 of file SV_Message_Queue.i.

References ACE_TRACE, and ACE_OS::msgrcv.

Referenced by ACE_Typed_SV_Message_Queue::recv.

00063 {
00064   ACE_TRACE ("ACE_SV_Message_Queue::recv");
00065   return ACE_OS::msgrcv (this->internal_id_, (void *) &mb, 
00066                          length, type, mflags);
00067 }

ASYS_INLINE int ACE_SV_Message_Queue::remove void   
 

Close down and remove the message queue from the system.

Definition at line 36 of file SV_Message_Queue.i.

References ACE_TRACE, control, internal_id_, and IPC_RMID.

Referenced by ACE_Typed_SV_Message_Queue::remove.

00037 {
00038   ACE_TRACE ("ACE_SV_Message_Queue::remove");
00039   int result = this->control (IPC_RMID);
00040   this->internal_id_ = -1;
00041   return result;
00042 }

ASYS_INLINE int ACE_SV_Message_Queue::send const ACE_SV_Message   mb,
int    length,
int    mflags = 0
 

Definition at line 70 of file SV_Message_Queue.i.

References ACE_TRACE, and ACE_OS::msgsnd.

00073 {
00074   ACE_TRACE ("ACE_SV_Message_Queue::send");
00075   return ACE_OS::msgsnd (this->internal_id_, (void *) &mb,
00076                          length, mflags);
00077 }

ASYS_INLINE void ACE_SV_Message_Queue::set_id int   
 

Set the underly internal id.

Definition at line 52 of file SV_Message_Queue.i.

References ACE_TRACE, and internal_id_.

00053 {
00054   ACE_TRACE ("ACE_SV_Message_Queue::set_id");
00055   this->internal_id_ = id;
00056 }


Member Data Documentation

ACE_SV_Message_Queue::ACE_ALLOC_HOOK_DECLARE
 

Declare the dynamic allocation hooks.

Definition at line 85 of file SV_Message_Queue.h.

int ACE_SV_Message_Queue::internal_id_ [protected]
 

Returned from the underlying <msgget> system call.

Definition at line 89 of file SV_Message_Queue.h.

Referenced by close, get_id, open, remove, and set_id.


The documentation for this class was generated from the following files:
Generated on Mon Jun 16 12:57:05 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002