You.i Engine
YiCondition.h
Go to the documentation of this file.
1 // © You i Labs Inc. 2000-2020. All rights reserved.
2 #ifndef _YI_CONDITION_H_
3 #define _YI_CONDITION_H_
4 
5 #include "signal/YiSignal.h"
6 
8 
19 {
20 public:
21  friend class CYIConditionEvaluator;
22 
23  CYICondition();
24  virtual ~CYICondition();
25 
29  void Set();
30 
34  void Unset();
35 
39  operator bool() const
40  {
41  return m_condition;
42  }
43 
44 private:
45  void SetAutoEvaluator(CYIConditionEvaluator *pEvaluator);
46  void Clear();
47 
48 private:
49  bool m_condition;
50  CYIConditionEvaluator *m_pEvaluator;
51 };
52 
68 {
69 public:
70  friend class CYICondition;
71 
73  virtual ~CYIConditionEvaluator();
74 
78  void Reset();
79 
85  void ClearConditions();
86 
92  void AddCondition(CYICondition *pCondition);
93 
98 
99 private:
100  void RemoveCondition(CYICondition *pCondition);
101  void Evaluate();
102  operator bool() const;
103 
104 private:
105  std::vector<CYICondition *> m_ConditionList;
106 };
107 
110 #endif // _YI_CONDITION_H_
Evaluates when CYICondition objects have been set, and notifies users.
Definition: YiCondition.h:67
virtual ~CYICondition()
friend class CYIConditionEvaluator
Definition: YiCondition.h:21
Definition: YiSignalHandler.h:175
CYISignal Success
Definition: YiCondition.h:97
Represents a boolean condition.
Definition: YiCondition.h:18
Signals and slots are a thread-safe and flexible communication framework that will allow various obje...
Definition: YiSignal.h:168