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

Typed_SV_Message_Queue.h

Go to the documentation of this file.
00001 /* -*- C++ -*- */
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    Typed_SV_Message_Queue.h
00006  *
00007  *  $Id: Typed_SV_Message_Queue.h,v 1.1.1.4 2003/02/21 18:36:32 chad Exp $
00008  *
00009  *  @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
00010  */
00011 //=============================================================================
00012 
00013 #ifndef ACE_TYPED_MESSAGE_QUEUE_H
00014 #define ACE_TYPED_MESSAGE_QUEUE_H
00015 #include "ace/pre.h"
00016 
00017 #include "ace/SV_Message_Queue.h"
00018 
00019 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00020 # pragma once
00021 #endif /* ACE_LACKS_PRAGMA_ONCE */
00022 
00023 #include "ace/Typed_SV_Message.h"
00024 
00025 /**
00026  * @class ACE_Typed_SV_Message_Queue
00027  *
00028  * @brief Defines the header file for the C++ wrapper facade for typed message queues.
00029  */
00030 template <class T>
00031 class ACE_Typed_SV_Message_Queue
00032 {
00033 public:
00034   enum
00035   {
00036     ACE_CREATE = IPC_CREAT,
00037     ACE_OPEN = 0,
00038     ACE_NOWAIT = IPC_NOWAIT
00039   };
00040 
00041   // = Initialization and termination operations.
00042   ACE_Typed_SV_Message_Queue (void);
00043   ACE_Typed_SV_Message_Queue (key_t external_id,
00044                               int create = ACE_OPEN,
00045                               int perms = ACE_DEFAULT_FILE_PERMS);
00046   int open (key_t external_id,
00047             int create = ACE_OPEN,
00048             int perms = ACE_DEFAULT_FILE_PERMS);
00049   int close (void);
00050   int remove (void);
00051   ~ACE_Typed_SV_Message_Queue (void);
00052 
00053   /// Send method.
00054   int send (const ACE_Typed_SV_Message<T> &mb, int mflags = 0);
00055 
00056   /// Recv method.
00057   int recv (ACE_Typed_SV_Message<T> &mb, int mflags = 0);
00058 
00059   /// Return the id of the underlying ACE_SV_Message_Queue.
00060   int get_id (void) const;
00061 
00062   /// Control the underlying message queue.
00063   int control (int option, void *arg = 0);
00064 
00065   /// Dump the state of an object.
00066   void dump (void) const;
00067 
00068   /// Declare the dynamic allocation hooks.
00069   ACE_ALLOC_HOOK_DECLARE;
00070 
00071 private:
00072   ACE_SV_Message_Queue message_queue_;
00073 };
00074 
00075 #if defined (__ACE_INLINE__)
00076 #include "ace/Typed_SV_Message_Queue.i"
00077 #endif /* __ACE_INLINE__ */
00078 
00079 #if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
00080 #include "ace/Typed_SV_Message_Queue.cpp"
00081 #endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
00082 
00083 #if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
00084 #pragma implementation ("Typed_SV_Message_Queue.cpp")
00085 #endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
00086 
00087 #include "ace/post.h"
00088 #endif /* ACE_TYPED_MESSAGE_QUEUE_H */

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