3 //==========================================================================
5 * @file SV_Message_Queue.h
7 * $Id: SV_Message_Queue.h 80826 2008-03-04 14:51:23Z wotte $
9 * @author Douglas C. Schmidt <schmidt@uci.edu>
11 //===========================================================================
13 #ifndef ACE_SV_MESSAGE_QUEUE_H
14 #define ACE_SV_MESSAGE_QUEUE_H
16 #include /**/ "ace/pre.h"
18 #include /**/ "ace/config-all.h"
20 #if !defined (ACE_LACKS_PRAGMA_ONCE)
22 #endif /* ACE_LACKS_PRAGMA_ONCE */
24 #include "ace/SV_Message.h"
25 #include "ace/os_include/sys/os_stat.h"
26 #include "ace/os_include/sys/os_ipc.h"
27 #include "ace/Default_Constants.h"
29 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
32 * @class ACE_SV_Message_Queue
34 * @brief Defines the header file for the C++ wrapper for System V IPC
37 class ACE_Export ACE_SV_Message_Queue
40 // = Useful symbolic constants.
43 ACE_CREATE
= IPC_CREAT
,
45 ACE_NOWAIT
= IPC_NOWAIT
48 // = Initialization and termination methods.
49 /// Open a message queue using the <external_id>.
50 ACE_SV_Message_Queue (void);
51 ACE_SV_Message_Queue (key_t external_id
,
52 int create
= ACE_SV_Message_Queue::ACE_OPEN
,
53 int perms
= ACE_DEFAULT_FILE_PERMS
);
54 int open (key_t external_id
,
55 int create
= ACE_SV_Message_Queue::ACE_OPEN
,
56 int perms
= ACE_DEFAULT_FILE_PERMS
);
58 ~ACE_SV_Message_Queue (void);
60 /// Close down this instance of the message queue without removing it
64 /// Close down and remove the message queue from the system.
67 // = Message transfer methods.
68 ssize_t
recv (ACE_SV_Message
&mb
,
73 int send (const ACE_SV_Message
&mb
,
77 /// Access the underlying control operations.
78 int control (int option
, void *arg
= 0);
80 /// Get the underly internal id.
81 int get_id (void) const;
83 /// Set the underly internal id.
86 /// Dump the state of an object.
87 void dump (void) const;
89 /// Declare the dynamic allocation hooks.
90 ACE_ALLOC_HOOK_DECLARE
;
93 /// Returned from the underlying <msgget> system call.
97 ACE_END_VERSIONED_NAMESPACE_DECL
99 #if defined (__ACE_INLINE__)
100 #include "ace/SV_Message_Queue.inl"
101 #endif /* __ACE_INLINE__ */
103 #include /**/ "ace/post.h"
105 #endif /* ACE_SV_MESSAGE_QUEUE_H */