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

SV_Message_Queue.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //==========================================================================
00004 /**
00005  *  @file    SV_Message_Queue.h
00006  *
00007  *  $Id: SV_Message_Queue.h,v 1.1.1.4 2003/02/21 18:36:32 chad Exp $
00008  *
00009  *  @author Douglas C. Schmidt <schmidt@uci.edu>
00010  */
00011 //===========================================================================
00012 
00013 #ifndef ACE_SV_MESSAGE_QUEUE_H
00014 #define ACE_SV_MESSAGE_QUEUE_H
00015 
00016 #include "ace/pre.h"
00017 
00018 #include "ace/config-all.h"
00019 
00020 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00021 # pragma once
00022 #endif /* ACE_LACKS_PRAGMA_ONCE */
00023 
00024 #include "ace/SV_Message.h"
00025 
00026 /**
00027  * @class ACE_SV_Message_Queue
00028  *
00029  * @brief Defines the header file for the C++ wrapper for System V IPC
00030  * message queues.
00031  */
00032 class ACE_Export ACE_SV_Message_Queue
00033 {
00034 public:
00035   // = Useful symbolic constants.
00036   enum
00037   {
00038     ACE_CREATE = IPC_CREAT,
00039     ACE_OPEN   = 0,
00040     ACE_NOWAIT = IPC_NOWAIT
00041   };
00042 
00043   // = Initialization and termination methods.
00044   /// Open a message queue using the <external_id>.
00045   ACE_SV_Message_Queue (void);
00046   ACE_SV_Message_Queue (key_t external_id,
00047                         int create = ACE_SV_Message_Queue::ACE_OPEN,
00048                         int perms = ACE_DEFAULT_FILE_PERMS);
00049   int open (key_t external_id,
00050             int create = ACE_SV_Message_Queue::ACE_OPEN,
00051             int perms = ACE_DEFAULT_FILE_PERMS);
00052 
00053   ~ACE_SV_Message_Queue (void);
00054 
00055   /// Close down this instance of the message queue without removing it
00056   /// from the system.
00057   int close (void);
00058 
00059   /// Close down and remove the message queue from the system.
00060   int remove (void);
00061 
00062   // = Message transfer methods.
00063   int recv (ACE_SV_Message &mb,
00064             int length,
00065             long mtype = 0,
00066             int mflags = 0);
00067 
00068   int send (const ACE_SV_Message &mb,
00069             int length,
00070             int mflags = 0);
00071 
00072   /// Access the underlying control operations.
00073   int control (int option, void *arg = 0);
00074 
00075   /// Get the underly internal id.
00076   int get_id (void) const;
00077 
00078   /// Set the underly internal id.
00079   void set_id (int);
00080 
00081   /// Dump the state of an object.
00082   void dump (void) const;
00083 
00084   /// Declare the dynamic allocation hooks.
00085   ACE_ALLOC_HOOK_DECLARE;
00086 
00087 protected:
00088   /// Returned from the underlying <msgget> system call.
00089   int internal_id_;
00090 };
00091 
00092 #if !defined (ACE_LACKS_INLINE_FUNCTIONS)
00093 #include "ace/SV_Message_Queue.i"
00094 #endif
00095 
00096 #include "ace/post.h"
00097 
00098 #endif /* ACE_SV_MESSAGE_QUEUE_H */

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