Skip to content

Commit

Permalink
Restyled by clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
restyled-commits authored and lpbeliveau-silabs committed Jul 24, 2023
1 parent 704394a commit 30e1de8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 41 deletions.
50 changes: 10 additions & 40 deletions src/app/reporting/ReportScheduler.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,8 @@ class ReportScheduler : public ReadHandler::Observer
MinIntervalElapsed = (1 << 0),
MaxIntervalElapsed = (1 << 1),
};
void SetTestFlags(TestFlags aFlag, bool aValue)
{
mFlags.Set(aFlag, aValue);
}
bool GetTestFlags(TestFlags aFlag) const
{
return mFlags.Has(aFlag);
}
void SetTestFlags(TestFlags aFlag, bool aValue) { mFlags.Set(aFlag, aValue); }
bool GetTestFlags(TestFlags aFlag) const { return mFlags.Has(aFlag); }
#endif // CONFIG_BUILD_FOR_HOST_UNIT_TEST

ReadHandlerNode(ReadHandler * aReadHandler, TimerDelegate * aTimerDelegate, ReportScheduler * aScheduler) :
Expand All @@ -89,10 +83,7 @@ class ReportScheduler : public ReadHandler::Observer
mReadHandler = aReadHandler;
SetIntervalTimeStamps(aReadHandler);
}
ReadHandler * GetReadHandler() const
{
return mReadHandler;
}
ReadHandler * GetReadHandler() const { return mReadHandler; }

/// @brief Check if the Node is reportable now, meaning its readhandler was made reportable by attribute dirtying and
/// handler state, and minimal time interval since last report has elapsed, or the maximal time interval since last
Expand All @@ -111,10 +102,7 @@ class ReportScheduler : public ReadHandler::Observer
#endif // CONFIG_BUILD_FOR_HOST_UNIT_TEST
}

bool IsEngineRunScheduled() const
{
return mEngineRunScheduled;
}
bool IsEngineRunScheduled() const { return mEngineRunScheduled; }
void SetEngineRunScheduled(bool aEngineRunScheduled)
{
mEngineRunScheduled = aEngineRunScheduled;
Expand Down Expand Up @@ -152,18 +140,9 @@ class ReportScheduler : public ReadHandler::Observer
mSyncTimestamp = aSyncTimestamp;
}

System::Clock::Timestamp GetMinTimestamp() const
{
return mMinTimestamp;
}
System::Clock::Timestamp GetMaxTimestamp() const
{
return mMaxTimestamp;
}
System::Clock::Timestamp GetSyncTimestamp() const
{
return mSyncTimestamp;
}
System::Clock::Timestamp GetMinTimestamp() const { return mMinTimestamp; }
System::Clock::Timestamp GetMaxTimestamp() const { return mMaxTimestamp; }
System::Clock::Timestamp GetSyncTimestamp() const { return mSyncTimestamp; }

private:
#ifdef CONFIG_BUILD_FOR_HOST_UNIT_TEST
Expand All @@ -190,21 +169,12 @@ class ReportScheduler : public ReadHandler::Observer

/// @brief Check whether a ReadHandler is reportable right now, taking into account its minimum and maximum intervals.
/// @param aReadHandler read handler to check
bool IsReportableNow(ReadHandler * aReadHandler)
{
return FindReadHandlerNode(aReadHandler)->IsReportableNow();
}
bool IsReportableNow(ReadHandler * aReadHandler) { return FindReadHandlerNode(aReadHandler)->IsReportableNow(); }
/// @brief Check if a ReadHandler is reportable without considering the timing
bool IsReadHandlerReportable(ReadHandler * aReadHandler) const
{
return aReadHandler->IsReportable();
}
bool IsReadHandlerReportable(ReadHandler * aReadHandler) const { return aReadHandler->IsReportable(); }

/// @brief Get the number of ReadHandlers registered in the scheduler's node pool
size_t GetNumReadHandlers() const
{
return mNodesPool.Allocated();
}
size_t GetNumReadHandlers() const { return mNodesPool.Allocated(); }

#ifdef CONFIG_BUILD_FOR_HOST_UNIT_TEST
void RunNodeCallbackForHandler(const ReadHandler * aReadHandler)
Expand Down
2 changes: 1 addition & 1 deletion src/app/reporting/SynchronizedReportSchedulerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ void SynchronizedReportSchedulerImpl::OnReadHandlerDestroyed(ReadHandler * aRead

mNodesPool.ReleaseObject(removeNode);

if (0 == mNodesPool.Allocated())
if (!mNodesPool.Allocated())
{
// Only cancel the timer if there are no more handlers registered
CancelReport();
Expand Down

0 comments on commit 30e1de8

Please sign in to comment.