Rudiments
semaphoreset.h
1 // Copyright (c) 1999-2002 David Muse
2 // See the COPYING file for more information.
3 
4 #ifndef RUDIMENTS_SEMAPHORESET_H
5 #define RUDIMENTS_SEMAPHORESET_H
6 
7 #include <rudiments/private/semaphoresetincludes.h>
8 
9 class semaphoresetprivate;
10 
46 class RUDIMENTS_DLLSPEC semaphoreset {
47  public:
48 
50  semaphoreset();
51 
55  ~semaphoreset();
56 
59  bool supportsTimedSemaphoreOperations();
60 
70  bool create(key_t key, mode_t permissions,
71  int32_t semcount, const int32_t *values);
72 
76  bool attach(key_t key, int32_t semcount);
77 
82  bool createOrAttach(key_t key, mode_t permissions,
83  int32_t semcount, const int32_t *values);
84 
92  void dontRemove();
93 
96  bool forceRemove();
97 
99  int32_t getId() const;
100 
102  bool wait(int32_t index);
103 
109  bool wait(int32_t index, int32_t seconds,
110  int32_t nanoseconds);
111 
113  bool signal(int32_t index);
114 
115 
118  bool waitWithUndo(int32_t index);
119 
126  bool waitWithUndo(int32_t index,
127  int32_t seconds, int32_t nanoseconds);
128 
131  bool signalWithUndo(int32_t index);
132 
133 
135  bool setValue(int32_t index, int32_t value);
136 
138  int32_t getValue(int32_t index);
139 
140 
147  bool setUserName(const char *username);
148 
156  bool setGroupName(const char *groupname);
157 
160  bool setUserId(uid_t uid);
161 
164  bool setGroupId(gid_t gid);
165 
168  bool setPermissions(mode_t permissions);
169 
170 
182  const char *getUserName();
183 
195  const char *getGroupName();
196 
199  uid_t getUserId();
200 
203  gid_t getGroupId();
204 
206  mode_t getPermissions();
207 
208 
211  int32_t getWaitingForZero(int32_t index);
212 
215  int32_t getWaitingForIncrement(int32_t index);
216 
220  void retryInterruptedOperations();
221 
225  void dontRetryInterruptedOperations();
226 
227  #include <rudiments/private/semaphoreset.h>
228 
229 };
230 
231 #endif
Definition: semaphoreset.h:46
Definition: permissions.h:28