Changes to attempt to silence bcc64x
[ACE_TAO.git] / ACE / ace / SV_Message_Queue.h
blob83cbd399ded40e2bc67f5634dc916c5da676c701
1 // -*- C++ -*-
3 //==========================================================================
4 /**
5 * @file SV_Message_Queue.h
7 * @author Douglas C. Schmidt <d.schmidt@vanderbilt.edu>
8 */
9 //===========================================================================
11 #ifndef ACE_SV_MESSAGE_QUEUE_H
12 #define ACE_SV_MESSAGE_QUEUE_H
14 #include /**/ "ace/pre.h"
16 #include /**/ "ace/config-all.h"
18 #if !defined (ACE_LACKS_PRAGMA_ONCE)
19 # pragma once
20 #endif /* ACE_LACKS_PRAGMA_ONCE */
22 #include "ace/SV_Message.h"
23 #include "ace/os_include/sys/os_stat.h"
24 #include "ace/os_include/sys/os_ipc.h"
25 #include "ace/Default_Constants.h"
27 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
29 /**
30 * @class ACE_SV_Message_Queue
32 * @brief Defines the header file for the C++ wrapper for System V IPC
33 * message queues.
35 class ACE_Export ACE_SV_Message_Queue
37 public:
38 // = Useful symbolic constants.
39 enum
41 ACE_CREATE = IPC_CREAT,
42 ACE_OPEN = 0,
43 ACE_NOWAIT = IPC_NOWAIT
46 /// Open a message queue using the <external_id>.
47 ACE_SV_Message_Queue ();
48 ACE_SV_Message_Queue (key_t external_id,
49 int create = ACE_SV_Message_Queue::ACE_OPEN,
50 int perms = ACE_DEFAULT_FILE_PERMS);
51 int open (key_t external_id,
52 int create = ACE_SV_Message_Queue::ACE_OPEN,
53 int perms = ACE_DEFAULT_FILE_PERMS);
55 ~ACE_SV_Message_Queue ();
57 /// Close down this instance of the message queue without removing it
58 /// from the system.
59 int close ();
61 /// Close down and remove the message queue from the system.
62 int remove ();
64 // = Message transfer methods.
65 ssize_t recv (ACE_SV_Message &mb,
66 int length,
67 long mtype = 0,
68 int mflags = 0);
70 int send (const ACE_SV_Message &mb,
71 int length,
72 int mflags = 0);
74 /// Access the underlying control operations.
75 int control (int option, void *arg = 0);
77 /// Get the underly internal id.
78 int get_id () const;
80 /// Set the underly internal id.
81 void set_id (int);
83 /// Dump the state of an object.
84 void dump () const;
86 /// Declare the dynamic allocation hooks.
87 ACE_ALLOC_HOOK_DECLARE;
89 protected:
90 /// Returned from the underlying <msgget> system call.
91 int internal_id_;
94 ACE_END_VERSIONED_NAMESPACE_DECL
96 #if defined (__ACE_INLINE__)
97 #include "ace/SV_Message_Queue.inl"
98 #endif /* __ACE_INLINE__ */
100 #include /**/ "ace/post.h"
102 #endif /* ACE_SV_MESSAGE_QUEUE_H */