UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
ipc_sem.hpp
1 /* ipcsem.hpp */
2 /* $Id$ */
3 #ifndef __ipcsem_hpp
4 #define __ipcsem_hpp
5 
6 #ifdef GE_BUILD
7 #include <types.hpp>
8 #else
9 #include <dcf/types.hpp>
10 #endif
11 
12 #include <string>
13 #include <sys/types.h>
14 
15 namespace dcf
16 {
18  class IPCSem
19  {
20  public:
21 
24  IPCSem(bool is_local = true);
25 
27  virtual ~IPCSem();
28 
30  dcf::error_t create(size_t res_num,
31  int id,
32  const std::string &fname,
33  int mask = 0666);
36  dcf::error_t create(size_t res_num,
37  key_t key,
38  int mask = 0666);
42 
45 
47  dcf::error_t allocate(size_t rn = 1);
48 
50  dcf::error_t release(size_t rn = 1);
51 
52  protected:
53 
55  int m_sid;
56 
58  key_t m_key;
59 
61  size_t m_res_num;
62 
64  int m_mask;
65 
67  bool m_is_local;
68 
69  private:
70 
73  int create_new_sem(size_t res_num, key_t key,
74  int mask, bool is_local) const;
75  };
76 };
77 
78 #endif /* ipcsem.hpp */
Definition: ipc_sem.hpp:18
error_t
Definition: types.hpp:11
dcf::error_t create(size_t res_num, int id, const std::string &fname, int mask=0666)
dcf::error_t operator--()
Definition: ipc_sem.hpp:44
int m_mask
Definition: ipc_sem.hpp:64
dcf::error_t release(size_t rn=1)
bool m_is_local
Definition: ipc_sem.hpp:67
key_t m_key
Definition: ipc_sem.hpp:58
int m_sid
Definition: ipc_sem.hpp:55
dcf::error_t allocate(size_t rn=1)
size_t m_res_num
Definition: ipc_sem.hpp:61
virtual ~IPCSem()
IPCSem(bool is_local=true)
dcf::error_t operator++()
Definition: ipc_sem.hpp:41