Adds the sdi_toolBox library (temporary version)
This commit is contained in:
49
sdi_toolBox_1.0.x/toolBox/sdi_toolBox/dateTime/iPause.h
Normal file
49
sdi_toolBox_1.0.x/toolBox/sdi_toolBox/dateTime/iPause.h
Normal file
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
{{copyright}}
|
||||
*/
|
||||
|
||||
/*
|
||||
{{version}}
|
||||
*/
|
||||
|
||||
/*
|
||||
{{license}}
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <chrono>
|
||||
|
||||
namespace sdi_toolBox::dateTime
|
||||
{
|
||||
//--------------------------------------------------------------
|
||||
/**
|
||||
* @brief Abstract interface for pause functionality.
|
||||
*
|
||||
* Provides a common interface for implementing pause or delay mechanisms.
|
||||
* Derived classes must implement the wait() method to pause execution
|
||||
* for a specified duration.
|
||||
*/
|
||||
class IPause
|
||||
{
|
||||
public:
|
||||
using Duration = std::chrono::milliseconds;
|
||||
|
||||
public:
|
||||
~IPause() = default; // Default destructor
|
||||
IPause(const IPause &obj) = default; // Copy constructor
|
||||
IPause(IPause &&obj) noexcept = default; // Move constructor
|
||||
IPause &operator=(const IPause &obj) = default; // Copy assignment operator
|
||||
IPause &operator=(IPause &&obj) noexcept = default; // Move assignment operator
|
||||
|
||||
/**
|
||||
* @brief Pause execution for the specified duration.
|
||||
* @param duration Duration of the pause.
|
||||
*/
|
||||
virtual void wait(const Duration &duration) const = 0;
|
||||
|
||||
protected:
|
||||
IPause() = default; // Default constructor
|
||||
};
|
||||
//--------------------------------------------------------------
|
||||
} // namespace sdi_toolBox::dateTime
|
||||
Reference in New Issue
Block a user