| 1 | #pragma once |
|---|---|
| 2 | |
| 3 | #include "basis/seadTypes.h" |
| 4 | #include "framework/seadCalculateTask.h" |
| 5 | #include "framework/seadTaskMgr.h" |
| 6 | #include "thread/seadAtomic.h" |
| 7 | |
| 8 | namespace sead |
| 9 | { |
| 10 | class InfLoopChecker : public CalculateTask |
| 11 | { |
| 12 | SEAD_TASK_SINGLETON(InfLoopChecker) |
| 13 | SEAD_RTTI_OVERRIDE(InfLoopChecker, CalculateTask) |
| 14 | |
| 15 | public: |
| 16 | struct InfLoopParam |
| 17 | { |
| 18 | }; |
| 19 | |
| 20 | using InfLoopEvent = DelegateEvent<const InfLoopParam&>; |
| 21 | |
| 22 | explicit InfLoopChecker(const TaskConstructArg& arg); |
| 23 | ~InfLoopChecker() override; |
| 24 | |
| 25 | void countUp(); |
| 26 | void prepare() override; |
| 27 | void calc() override; |
| 28 | |
| 29 | InfLoopEvent& getEvent() { return mEvent; } |
| 30 | |
| 31 | private: |
| 32 | void onInfLoop_(); |
| 33 | |
| 34 | u32 mLoopCount; |
| 35 | u32 mLoopThreshold; |
| 36 | bool mEnabled; |
| 37 | InfLoopEvent mEvent; |
| 38 | sead::Atomic<u32> mSkipCounter; |
| 39 | }; |
| 40 | } // namespace sead |
| 41 |