Adds the sdi_toolBox library (temporary version)

This commit is contained in:
Sylvain Schneider
2026-03-12 16:31:18 +01:00
parent 0601326e2b
commit b5d0fef4d9
23 changed files with 28422 additions and 0 deletions

View File

@@ -0,0 +1,55 @@
/*
{{copyright}}
*/
/*
{{version}}
*/
/*
{{license}}
*/
#pragma once
#include "iTimer.h"
namespace sdi_toolBox::dateTime
{
//--------------------------------------------------------------
/**
* @brief Standard timer implementation using std::chrono.
*
* Implements ITimer using std::chrono::high_resolution_clock for
* high-precision timing in standard C++ environments.
*/
class Timer : public ITimer
{
public:
Timer(); // Default constructor
~Timer() = default; // Default destructor
Timer(const Timer &obj) = default; // Copy constructor
Timer(Timer &&obj) noexcept = default; // Move constructor
Timer &operator=(const Timer &obj) = default; // Copy assignment operator
Timer &operator=(Timer &&obj) noexcept = default; // Move assignment operator
/**
* @brief Returns the current time point using std::chrono::high_resolution_clock.
* @return The current time point.
*/
[[nodiscard]] TimePoint now() const override;
};
//--------------------------------------------------------------
/* Default constructor */
inline Timer::Timer()
{
reset();
}
//--------------------------------------------------------------
/* Get the current timepoint */
inline Timer::TimePoint Timer::now() const
{
return Clock::now();
}
//--------------------------------------------------------------
} // namespace sdi_toolBox::dateTime