UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
sem.hpp
1 /* sem.hpp */
2 /* $Id$ */
3 #ifndef __sem_hpp
4 #define __sem_hpp
5 
6 #ifdef GE_BUILD
7 #include <types.hpp>
8 #else
9 #include <dcf/types.hpp>
10 #endif
11 
12 namespace dcf
13 {
15  class Sem
16  {
17  public:
18 
20  Sem(int /*res_num*/) {};
21 
23  virtual ~Sem() {};
24 
27  virtual dcf::error_t allocate(int rn) = 0;
28 
31  virtual dcf::error_t release(int rn) = 0;
32 
34  virtual dcf::error_t available(int &rn) const = 0;
35 
37  dcf::error_t operator--() { return allocate(1); }
38 
40  dcf::error_t operator++() { return release(1); }
41 
42  protected:
43  };
44 };
45 
46 #endif /* sem.hpp */
error_t
Definition: types.hpp:11
Sem(int)
Definition: sem.hpp:20
Definition: sem.hpp:15
virtual dcf::error_t release(int rn)=0
virtual dcf::error_t allocate(int rn)=0
dcf::error_t operator++()
Definition: sem.hpp:40
dcf::error_t operator--()
Definition: sem.hpp:37
virtual dcf::error_t available(int &rn) const =0
virtual ~Sem()
Definition: sem.hpp:23