Import of Mangos
[auctionmangos.git] / dep / ACE_wrappers / ace / SV_Message_Queue.h
blob3698ca90da772788245220e11c90f832ac63c85a
1 // -*- C++ -*-
3 //==========================================================================
4 /**
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)
21 # 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
31 /**
32 * @class ACE_SV_Message_Queue
34 * @brief Defines the header file for the C++ wrapper for System V IPC
35 * message queues.
37 class ACE_Export ACE_SV_Message_Queue
39 public:
40 // = Useful symbolic constants.
41 enum
43 ACE_CREATE = IPC_CREAT,
44 ACE_OPEN = 0,
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
61 /// from the system.
62 int close (void);
64 /// Close down and remove the message queue from the system.
65 int remove (void);
67 // = Message transfer methods.
68 ssize_t recv (ACE_SV_Message &mb,
69 int length,
70 long mtype = 0,
71 int mflags = 0);
73 int send (const ACE_SV_Message &mb,
74 int length,
75 int mflags = 0);
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.
84 void set_id (int);
86 /// Dump the state of an object.
87 void dump (void) const;
89 /// Declare the dynamic allocation hooks.
90 ACE_ALLOC_HOOK_DECLARE;
92 protected:
93 /// Returned from the underlying <msgget> system call.
94 int internal_id_;
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 */