Rudiments
sharedmemory.h
1 // Copyright (c) 1999-2002 David Muse
2 // See the COPYING file for more information.
3 
4 #ifndef RUDIMENTS_SHAREDMEMORY_H
5 #define RUDIMENTS_SHAREDMEMORY_H
6 
7 #include <rudiments/private/sharedmemoryincludes.h>
8 
9 #ifdef RUDIMENTS_NAMESPACE
10 namespace rudiments {
11 #endif
12 
13 class sharedmemoryprivate;
14 
25 class RUDIMENTS_DLLSPEC sharedmemory {
26  public:
28  sharedmemory();
29 
34  ~sharedmemory();
35 
42  bool create(key_t key, size_t size, mode_t permissions);
43 
44  /*8 Attaches to a shared memory identified by "key". */
45  bool attach(key_t key);
46 
51  bool createOrAttach(key_t key, size_t size,
52  mode_t permissions);
53 
61  void dontRemove();
62 
65  bool forceRemove();
66 
69  int32_t getId() const;
70 
74  void *getPointer() const;
75 
83  bool setUserName(const char *username);
84 
92  bool setGroupName(const char *groupname);
93 
96  bool setUserId(uid_t uid);
97 
100  bool setGroupId(gid_t gid);
101 
104  bool setPermissions(mode_t permissions);
105 
113  const char *getUserName();
114 
122  const char *getGroupName();
123 
126  uid_t getUserId();
127 
130  gid_t getGroupId();
131 
134  mode_t getPermissions();
135 
136  #include <rudiments/private/sharedmemory.h>
137 
138 };
139 
140 #ifdef RUDIMENTS_NAMESPACE
141 }
142 #endif
143 
144 #endif