Rudiments
|
00001 // Copyright (c) 1999-2002 David Muse 00002 // See the COPYING file for more information. 00003 00004 #ifndef RUDIMENTS_SEMAPHORESET_H 00005 #define RUDIMENTS_SEMAPHORESET_H 00006 00007 #include <rudiments/private/semaphoresetincludes.h> 00008 00009 #ifdef RUDIMENTS_NAMESPACE 00010 namespace rudiments { 00011 #endif 00012 00013 class semaphoresetprivate; 00014 00050 class RUDIMENTS_DLLSPEC semaphoreset { 00051 public: 00052 00054 semaphoreset(); 00055 00059 ~semaphoreset(); 00060 00063 bool supportsTimedSemaphoreOperations(); 00064 00074 bool create(key_t key, mode_t permissions, 00075 int32_t semcount, const int32_t *values); 00076 00080 bool attach(key_t key, int32_t semcount); 00081 00086 bool createOrAttach(key_t key, mode_t permissions, 00087 int32_t semcount, const int32_t *values); 00088 00096 void dontRemove(); 00097 00100 bool forceRemove(); 00101 00103 int32_t getId() const; 00104 00106 bool wait(int32_t index); 00107 00113 bool wait(int32_t index, long seconds, long nanoseconds); 00114 00116 bool signal(int32_t index); 00117 00118 00121 bool waitWithUndo(int32_t index); 00122 00129 bool waitWithUndo(int32_t index, 00130 long seconds, long nanoseconds); 00131 00134 bool signalWithUndo(int32_t index); 00135 00136 00138 bool setValue(int32_t index, int32_t value); 00139 00141 int32_t getValue(int32_t index); 00142 00143 00150 bool setUserName(const char *username); 00151 00159 bool setGroupName(const char *groupname); 00160 00163 bool setUserId(uid_t uid); 00164 00167 bool setGroupId(gid_t gid); 00168 00171 bool setPermissions(mode_t permissions); 00172 00173 00185 const char *getUserName(); 00186 00198 const char *getGroupName(); 00199 00202 uid_t getUserId(); 00203 00206 gid_t getGroupId(); 00207 00209 mode_t getPermissions(); 00210 00211 00214 int32_t getWaitingForZero(int32_t index); 00215 00218 int32_t getWaitingForIncrement(int32_t index); 00219 00223 void retryInterruptedOperations(); 00224 00228 void dontRetryInterruptedOperations(); 00229 00230 #include <rudiments/private/semaphoreset.h> 00231 00232 }; 00233 00234 #ifdef RUDIMENTS_NAMESPACE 00235 } 00236 #endif 00237 00238 #endif