Emergency 20 Dokumentation  4.2.0
RightsManager-inl.h
Go to the documentation of this file.
1 // Copyright (C) 2012-2018 Promotion Software GmbH
2 
3 
4 //[-------------------------------------------------------]
5 //[ Namespace ]
6 //[-------------------------------------------------------]
7 namespace em5
8 {
9 
10 
11  //[-------------------------------------------------------]
12  //[ Public methods ]
13  //[-------------------------------------------------------]
15  {
16  // Nothing here
17  }
18 
19  inline bool RightsManager::hasRight(const qsf::StringHash& id) const
20  {
21  return (mRightIds.find(id) != mRightIds.cend());
22  }
23 
25  {
26  return mRightIds;
27  }
28 
29  inline void RightsManager::setRightIds(const RightIds& rightIds)
30  {
31  mRightIds = rightIds;
32  RightsChange(*this);
33  }
34 
35 
36 //[-------------------------------------------------------]
37 //[ Namespace ]
38 //[-------------------------------------------------------]
39 } // em5
Definition: ActionPriority.h:13
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
bool hasRight(const qsf::StringHash &id) const
Check whether or not the requested right is set.
Definition: RightsManager-inl.h:19
const RightIds & getRightIds() const
Return the rights.
Definition: RightsManager-inl.h:24
void setRightIds(const RightIds &rightIds)
Set the rights.
Definition: RightsManager-inl.h:29
virtual ~RightsManager()
Destructor.
Definition: RightsManager-inl.h:14
Compile time string hash class.
Definition: StringHash.h:59