refactor(Core): apply clang-tidy modernize-* (#9975)

Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com>
This commit is contained in:
Francesco Borzì
2022-01-17 14:35:07 +01:00
committed by GitHub
parent fe4899202d
commit 9dc88def35
71 changed files with 533 additions and 534 deletions

View File

@@ -43,9 +43,9 @@ class BasicEvent
public:
BasicEvent()
: m_abortState(AbortState::STATE_RUNNING), m_addTime(0), m_execTime(0) { }
= default;
virtual ~BasicEvent() { } // override destructor to perform some actions on event removal
virtual ~BasicEvent() = default; // override destructor to perform some actions on event removal
// this method executes when the event is triggered
// return false if event does not want to be deleted
@@ -61,15 +61,15 @@ class BasicEvent
private:
void SetAborted();
bool IsRunning() const { return (m_abortState == AbortState::STATE_RUNNING); }
bool IsAbortScheduled() const { return (m_abortState == AbortState::STATE_ABORT_SCHEDULED); }
bool IsAborted() const { return (m_abortState == AbortState::STATE_ABORTED); }
[[nodiscard]] bool IsRunning() const { return (m_abortState == AbortState::STATE_RUNNING); }
[[nodiscard]] bool IsAbortScheduled() const { return (m_abortState == AbortState::STATE_ABORT_SCHEDULED); }
[[nodiscard]] bool IsAborted() const { return (m_abortState == AbortState::STATE_ABORTED); }
AbortState m_abortState; // set by externals when the event is aborted, aborted events don't execute
AbortState m_abortState{AbortState::STATE_RUNNING}; // set by externals when the event is aborted, aborted events don't execute
// these can be used for time offset control
uint64 m_addTime; // time when the event was added to queue, filled by event handler
uint64 m_execTime; // planned time of next execution, filled by event handler
uint64 m_addTime{0}; // time when the event was added to queue, filled by event handler
uint64 m_execTime{0}; // planned time of next execution, filled by event handler
};
template<typename T>
@@ -97,7 +97,7 @@ typedef std::multimap<uint64, BasicEvent*> EventList;
class EventProcessor
{
public:
EventProcessor() : m_time(0) { }
EventProcessor() = default;
~EventProcessor();
void Update(uint32 p_time);
@@ -118,7 +118,7 @@ class EventProcessor
[[nodiscard]] uint64 CalculateQueueTime(uint64 delay) const;
protected:
uint64 m_time;
uint64 m_time{0};
EventList m_events;
bool m_aborting;
};