Rudiments
|
00001 // Copyright (c) 1999-2002 David Muse 00002 // See the COPYING file for more information. 00003 00004 #ifndef RUDIMENTS_SHAREDMEMORY_H 00005 #define RUDIMENTS_SHAREDMEMORY_H 00006 00007 #include <rudiments/private/sharedmemoryincludes.h> 00008 00009 #ifdef RUDIMENTS_NAMESPACE 00010 namespace rudiments { 00011 #endif 00012 00013 class sharedmemoryprivate; 00014 00025 class RUDIMENTS_DLLSPEC sharedmemory { 00026 public: 00028 sharedmemory(); 00029 00034 ~sharedmemory(); 00035 00042 bool create(key_t key, size_t size, mode_t permissions); 00043 00044 /*8 Attaches to a shared memory identified by "key". */ 00045 bool attach(key_t key); 00046 00051 bool createOrAttach(key_t key, size_t size, 00052 mode_t permissions); 00053 00061 void dontRemove(); 00062 00065 bool forceRemove(); 00066 00069 int32_t getId() const; 00070 00074 void *getPointer() const; 00075 00083 bool setUserName(const char *username); 00084 00092 bool setGroupName(const char *groupname); 00093 00096 bool setUserId(uid_t uid); 00097 00100 bool setGroupId(gid_t gid); 00101 00104 bool setPermissions(mode_t permissions); 00105 00113 const char *getUserName(); 00114 00122 const char *getGroupName(); 00123 00126 uid_t getUserId(); 00127 00130 gid_t getGroupId(); 00131 00134 mode_t getPermissions(); 00135 00136 #include <rudiments/private/sharedmemory.h> 00137 00138 }; 00139 00140 #ifdef RUDIMENTS_NAMESPACE 00141 } 00142 #endif 00143 00144 #endif