Formatting: move big inlines out of class def

This commit is contained in:
2025-10-31 13:47:00 -04:00
parent ebbb2b1345
commit 0de031c74b
+37 -29
View File
@@ -69,7 +69,42 @@ public:
scheduleNextTimeout();
}
void stop()
void stop();
private:
void onTimeout(const boost::system::error_code& error);
public:
device::DeviceAttachmentSpec deviceAttachmentSpec;
std::vector<StimFrame> frames_;
protected:
SpinLock frameAssemblyRateLimiter;
private:
boost::asio::io_service& ioService;
std::atomic<bool> shouldContinue;
boost::asio::deadline_timer timer;
void scheduleNextTimeout(int delayMs = CONFIG_STIMBUFF_FRAME_PERIOD_MS)
{
if (!shouldContinue.load())
{ return; }
// Schedule the next timeout using the provided delay
timer.expires_from_now(
boost::posix_time::milliseconds(delayMs));
timer.async_wait(
std::bind(
&StimulusBuffer::onTimeout, this, std::placeholders::_1));
}
};
/** Inline methods
******************************************************************************/
inline void StimulusBuffer::stop()
{
shouldContinue.store(false);
@@ -97,33 +132,7 @@ public:
timer.cancel();
}
public:
device::DeviceAttachmentSpec deviceAttachmentSpec;
std::vector<StimFrame> frames_;
protected:
SpinLock frameAssemblyRateLimiter;
private:
boost::asio::io_service& ioService;
std::atomic<bool> shouldContinue;
boost::asio::deadline_timer timer;
void scheduleNextTimeout(int delayMs = CONFIG_STIMBUFF_FRAME_PERIOD_MS)
{
if (!shouldContinue.load())
{ return; }
// Schedule the next timeout using the provided delay
timer.expires_from_now(
boost::posix_time::milliseconds(delayMs));
timer.async_wait(
std::bind(
&StimulusBuffer::onTimeout, this, std::placeholders::_1));
}
void onTimeout(const boost::system::error_code& error)
inline void StimulusBuffer::onTimeout(const boost::system::error_code& error)
{
// Timer was cancelled, which is expected when stopping
if (error == boost::asio::error::operation_aborted) {
@@ -163,7 +172,6 @@ private:
// Schedule next timeout with the pre-determined duration
scheduleNextTimeout(nextWakeupDelayMs);
}
};
} // namespace stim_buff
} // namespace smo