Emergency 20 Dokumentation  4.2.0
RightsManager.h
Go to the documentation of this file.
1 // Copyright (C) 2012-2018 Promotion Software GmbH
2 
3 
4 //[-------------------------------------------------------]
5 //[ Header guard ]
6 //[-------------------------------------------------------]
7 #pragma once
8 
9 
10 //[-------------------------------------------------------]
11 //[ Includes ]
12 //[-------------------------------------------------------]
13 #include "em5/Export.h"
14 
17 
18 #include <boost/signals2.hpp>
19 
20 #include <unordered_set>
21 
22 
23 //[-------------------------------------------------------]
24 //[ Namespace ]
25 //[-------------------------------------------------------]
26 namespace em5
27 {
28 
29 
30  //[-------------------------------------------------------]
31  //[ Classes ]
32  //[-------------------------------------------------------]
38  {
39 
40 
41  //[-------------------------------------------------------]
42  //[ Public Boost signals ]
43  //[-------------------------------------------------------]
44  public:
45  boost::signals2::signal<void (const RightsManager&)> RightsChange;
46 
47 
48  //[-------------------------------------------------------]
49  //[ Public definitions ]
50  //[-------------------------------------------------------]
51  public:
52  typedef std::unordered_set<uint32_t> RightIds;
53 
54 
55  //[-------------------------------------------------------]
56  //[ Public methods ]
57  //[-------------------------------------------------------]
58  public:
63  RightsManager();
64 
69  inline virtual ~RightsManager();
70 
81  inline bool hasRight(const qsf::StringHash& id) const;
82 
90  inline const RightIds& getRightIds() const;
91 
99  inline void setRightIds(const RightIds& rightIds);
100 
101 
102  //[-------------------------------------------------------]
103  //[ Private data ]
104  //[-------------------------------------------------------]
105  private:
106  RightIds mRightIds;
107 
108 
109  };
110 
111 
112 //[-------------------------------------------------------]
113 //[ Namespace ]
114 //[-------------------------------------------------------]
115 } // qsf
116 
117 
118 //[-------------------------------------------------------]
119 //[ Implementation ]
120 //[-------------------------------------------------------]
Definition: ActionPriority.h:13
EMERGENCY 5 rights manager.
Definition: RightsManager.h:37
Rights manager class.
Definition: RightsManager.h:50
#define EM5_API_EXPORT
Definition: Export.h:28
boost::signals2::signal< void(const RightsManager &)> RightsChange
Boost signal emitted after a rights change has occurred.
Definition: RightsManager.h:45
std::unordered_set< uint32_t > RightIds
Definition: RightsManager.h:52
Unique instance interface.
Definition: UniqueInstance.h:34
Compile time string hash class.
Definition: StringHash.h:59