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

SV_Message_Queue.i

Go to the documentation of this file.
00001 /* -*- C++ -*- */
00002 // $Id: SV_Message_Queue.i,v 1.1.1.2 2001/12/04 14:33:08 chad Exp $
00003 
00004 // SV_Message_Queue.i
00005 
00006 #include "ace/SV_Message_Queue.h"
00007 
00008 // Open a message queue using the <external_id>.
00009 
00010 ASYS_INLINE int
00011 ACE_SV_Message_Queue::open (key_t external_id, int create, int perms)
00012 {
00013   ACE_TRACE ("ACE_SV_Message_Queue::open");
00014   return this->internal_id_ = ACE_OS::msgget (external_id, create | perms);
00015 }
00016 
00017 // What does it mean to close a message queue?!
00018 
00019 ASYS_INLINE int
00020 ACE_SV_Message_Queue::close (void)
00021 {
00022   ACE_TRACE ("ACE_SV_Message_Queue::close");
00023   this->internal_id_ = -1;
00024   return 1;
00025 }
00026 
00027 ASYS_INLINE int
00028 ACE_SV_Message_Queue::control (int option, void *arg)
00029 {
00030   ACE_TRACE ("ACE_SV_Message_Queue::control");
00031   return ACE_OS::msgctl (this->internal_id_, option, 
00032                          (msqid_ds *) arg);
00033 }
00034 
00035 ASYS_INLINE int
00036 ACE_SV_Message_Queue::remove (void)
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 }
00043 
00044 ASYS_INLINE int
00045 ACE_SV_Message_Queue::get_id (void) const
00046 {
00047   ACE_TRACE ("ACE_SV_Message_Queue::get_id");
00048   return this->internal_id_;
00049 }
00050 
00051 ASYS_INLINE void
00052 ACE_SV_Message_Queue::set_id (int id)
00053 {
00054   ACE_TRACE ("ACE_SV_Message_Queue::set_id");
00055   this->internal_id_ = id;
00056 }
00057 
00058 ASYS_INLINE int
00059 ACE_SV_Message_Queue::recv (ACE_SV_Message &mb, 
00060                             int length, 
00061                             long type, 
00062                             int mflags)
00063 {
00064   ACE_TRACE ("ACE_SV_Message_Queue::recv");
00065   return ACE_OS::msgrcv (this->internal_id_, (void *) &mb, 
00066                          length, type, mflags);
00067 }
00068 
00069 ASYS_INLINE int
00070 ACE_SV_Message_Queue::send (const ACE_SV_Message &mb, 
00071                             int length, 
00072                             int mflags)
00073 {
00074   ACE_TRACE ("ACE_SV_Message_Queue::send");
00075   return ACE_OS::msgsnd (this->internal_id_, (void *) &mb,
00076                          length, mflags);
00077 }
00078 

Generated on Mon Jun 16 11:21:32 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002