BVB Source Codes

CRYENGINE Show SensedInclusionSet.h Source code

Return Download CRYENGINE: download SensedInclusionSet.h Source code - Download CRYENGINE Source code - Type:.h
  1. // Copyright 2001-2016 Crytek GmbH / Crytek Group. All rights reserved.
  2.  
  3. #ifndef __SENSEDINCLUSIONSET_H__
  4. #define __SENSEDINCLUSIONSET_H__
  5.  
  6. #pragma once
  7.  
  8. template<class T>
  9. class SensedInclusionSet
  10. {
  11. public:
  12.         SensedInclusionSet(bool sense) : m_sense(sense) {}
  13.  
  14.         void Set(const T& value, bool included)
  15.         {
  16.                 if (included != m_sense)
  17.                         m_set.insert(value);
  18.                 else
  19.                         m_set.erase(value);
  20.         }
  21.  
  22.         bool Get(const T& value) const
  23.         {
  24.                 return (m_set.find(value) != m_set.end()) != m_sense;
  25.         }
  26.  
  27.         void Reset(bool sense)
  28.         {
  29.                 m_set.clear();
  30.                 m_sense = sense;
  31.         }
  32.  
  33.         void GetMemoryStatistics(ICrySizer* s) const
  34.         {
  35.                 s->AddObject(m_set);
  36.         }
  37.  
  38. private:
  39.         bool        m_sense;
  40.         std::set<T> m_set;
  41. };
  42.  
  43. #endif
  44.  
downloadSensedInclusionSet.h Source code - Download CRYENGINE Source code
Related Source Codes/Software:
postal - 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top