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 
44 class RUDIMENTS_DLLSPEC semaphoreset {
45  public:
46 
48  semaphoreset();
49 
53  ~semaphoreset();
54 
57  bool supportsTimedSemaphoreOperations();
58 
64  bool supportsUndoSemaphoreOperations();
65 
75  bool create(key_t key, mode_t permissions,
76  int32_t semcount, const int32_t *values);
77 
81  bool attach(key_t key, int32_t semcount);
82 
87  bool createOrAttach(key_t key, mode_t permissions,
88  int32_t semcount, const int32_t *values);
89 
97  void dontRemove();
98 
101  bool forceRemove();
102 
104  int32_t getId() const;
105 
107  bool wait(int32_t index);
108 
118  bool wait(int32_t index, int32_t seconds,
119  int32_t nanoseconds);
120 
122  bool signal(int32_t index);
123 
124 
127  bool waitWithUndo(int32_t index);
128 
139  bool waitWithUndo(int32_t index,
140  int32_t seconds, int32_t nanoseconds);
141 
144  bool signalWithUndo(int32_t index);
145 
146 
148  bool setValue(int32_t index, int32_t value);
149 
151  int32_t getValue(int32_t index);
152 
153 
160  bool setUserName(const char *username);
161 
169  bool setGroupName(const char *groupname);
170 
173  bool setUserId(uid_t uid);
174 
177  bool setGroupId(gid_t gid);
178 
181  bool setPermissions(mode_t permissions);
182 
183 
195  const char *getUserName();
196 
208  const char *getGroupName();
209 
212  uid_t getUserId();
213 
216  gid_t getGroupId();
217 
219  mode_t getPermissions();
220 
221 
224  int32_t getWaitingForZero(int32_t index);
225 
228  int32_t getWaitingForIncrement(int32_t index);
229 
233  void retryInterruptedOperations();
234 
238  void dontRetryInterruptedOperations();
239 
242  static bool supported();
243 
244  #include <rudiments/private/semaphoreset.h>
245 };
246 
247 #endif
Definition: semaphoreset.h:44
Definition: permissions.h:28