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 #ifdef RUDIMENTS_NAMESPACE
10 namespace rudiments {
11 #endif
12 
13 class semaphoresetprivate;
14 
50 class RUDIMENTS_DLLSPEC semaphoreset {
51  public:
52 
54  semaphoreset();
55 
59  ~semaphoreset();
60 
63  bool supportsTimedSemaphoreOperations();
64 
74  bool create(key_t key, mode_t permissions,
75  int32_t semcount, const int32_t *values);
76 
80  bool attach(key_t key, int32_t semcount);
81 
86  bool createOrAttach(key_t key, mode_t permissions,
87  int32_t semcount, const int32_t *values);
88 
96  void dontRemove();
97 
100  bool forceRemove();
101 
103  int32_t getId() const;
104 
106  bool wait(int32_t index);
107 
113  bool wait(int32_t index, long seconds, long nanoseconds);
114 
116  bool signal(int32_t index);
117 
118 
121  bool waitWithUndo(int32_t index);
122 
129  bool waitWithUndo(int32_t index,
130  long seconds, long nanoseconds);
131 
134  bool signalWithUndo(int32_t index);
135 
136 
138  bool setValue(int32_t index, int32_t value);
139 
141  int32_t getValue(int32_t index);
142 
143 
150  bool setUserName(const char *username);
151 
159  bool setGroupName(const char *groupname);
160 
163  bool setUserId(uid_t uid);
164 
167  bool setGroupId(gid_t gid);
168 
171  bool setPermissions(mode_t permissions);
172 
173 
185  const char *getUserName();
186 
198  const char *getGroupName();
199 
202  uid_t getUserId();
203 
206  gid_t getGroupId();
207 
209  mode_t getPermissions();
210 
211 
214  int32_t getWaitingForZero(int32_t index);
215 
218  int32_t getWaitingForIncrement(int32_t index);
219 
223  void retryInterruptedOperations();
224 
228  void dontRetryInterruptedOperations();
229 
230  #include <rudiments/private/semaphoreset.h>
231 
232 };
233 
234 #ifdef RUDIMENTS_NAMESPACE
235 }
236 #endif
237 
238 #endif