One independently timed interval contributing to a shared Clock.
More...
#include <StormByte/telemetry.hxx>
|
| | Sample () noexcept=default |
| | Construct an empty, inactive sample token.
|
| | Sample (const Sample &other)=delete |
| | Copy construction is disabled for single-owner sample tokens.
|
| Sample & | operator= (const Sample &other)=delete |
| | Copy assignment is disabled for single-owner sample tokens.
|
| | Sample (Sample &&other) noexcept |
| | Transfer responsibility for recording the active sample.
|
| Sample & | operator= (Sample &&other) noexcept |
| | Record this sample and take responsibility for another.
|
| | ~Sample () noexcept |
| | Record this sample if it is still active.
|
| bool | Active () const noexcept |
| | Whether this token owns a measurement that will be recorded.
|
| STORMBYTE_FORCE_INLINE std::chrono::microseconds | Stop () noexcept |
| | Complete and record this sample once.
|
One independently timed interval contributing to a shared Clock.
Each sample owns its start time. Samples from the same Clock may overlap or nest on any threads without replacing one another. Stop is idempotent; an active sample is recorded on explicit Stop or destruction. A Sample is a single-owner token and must not be accessed concurrently by multiple threads. It may be moved to the thread that will stop it.
◆ Sample() [1/3]
| StormByte::Clock::Sample::Sample |
( |
| ) |
|
|
defaultnoexcept |
Construct an empty, inactive sample token.
◆ Sample() [2/3]
| StormByte::Clock::Sample::Sample |
( |
const Sample & | other | ) |
|
|
delete |
Copy construction is disabled for single-owner sample tokens.
- Parameters
-
| other | Source sample; it remains owned by its current token. |
◆ Sample() [3/3]
| StormByte::Clock::Sample::Sample |
( |
Sample && | other | ) |
|
|
noexcept |
Transfer responsibility for recording the active sample.
- Parameters
-
| other | Source sample; it becomes inactive. |
◆ ~Sample()
| StormByte::Clock::Sample::~Sample |
( |
| ) |
|
|
noexcept |
Record this sample if it is still active.
◆ Active()
| bool StormByte::Clock::Sample::Active |
( |
| ) |
const |
|
noexcept |
Whether this token owns a measurement that will be recorded.
- Returns
- False for an empty token, after Stop, or when best-effort creation failed.
◆ operator=() [1/2]
| Sample & StormByte::Clock::Sample::operator= |
( |
const Sample & | other | ) |
|
|
delete |
Copy assignment is disabled for single-owner sample tokens.
- Parameters
-
- Returns
- No value; this operation is deleted.
◆ operator=() [2/2]
| Sample & StormByte::Clock::Sample::operator= |
( |
Sample && | other | ) |
|
|
noexcept |
Record this sample and take responsibility for another.
- Parameters
-
| other | Source sample; it becomes inactive. |
- Returns
- This sample token.
◆ Stop()
Complete and record this sample once.
- Returns
- This sample's elapsed microseconds; repeated calls return the same value. Built in the caller. The DLL returns the tick count.
◆ Clock
The documentation for this class was generated from the following file: