timestamp Class
Deprecated clock reading. More...
Declaration
Included Headers
Public Constructors Index
| timestamp (const timespec &ts) noexcept | |
|
Constructs a timestamp with a given time. More... | |
| timestamp (const timestamp &)=default | |
|
Defaulted copy constructor. More... | |
| timestamp (timestamp &&)=default | |
|
Defaulted move constructor. More... | |
| timestamp (void) noexcept | |
|
Constructs a timestamp with the current time. More... | |
Public Destructor Index
| ~timestamp ()=default | |
|
Defaulted destructor. More... | |
Public Operators Index
| timestamp & | operator= (const timestamp &)=default |
|
Defaulted copy assignment operator. More... | |
| timestamp & | operator= (timestamp &&)=default |
|
Defaulted move assignment operator. More... | |
Public Member Functions Index
| bool | has_clock (void) const noexcept |
|
Checks whether the value is a clock reading. More... | |
| const timespec & | value (void) const noexcept |
|
Returns the stored time. More... | |
| timespec & | value (void) noexcept |
|
Returns the stored time, for modification. More... | |
Protected Member Attributes Index
| timespec | value_ {} |
|
The stored time. More... | |
Description
Deprecated clock reading.
The v5.0.1 class of the two readings kept by detail::timestamps, restored for the applications that used it directly; the framework no longer uses it, since stopwatch keeps the readings as timespec members. The timings are internal; use stopwatch instead.
A zero timespec means that the clock was not read, or that the platform has no clock.
The data member is protected, as in v5.0.1, so that the existing derived classes can still access it.
- Deprecated
-
the timings are internal (since 6.0.0)
Definition at line 2335 of file deprecated.h.
Public Constructors
timestamp()
| inline noexcept |
Constructs a timestamp with a given time.
Not explicit, as in v5.0.1, so that a timespec converts implicitly.
- Parameters
-
ts The time to be stored.
Copies ts into the stored value.
Declaration at line 2356 of file deprecated.h, definition at line 1297 of file deprecated-inlines.h.
timestamp()
| default |
Defaulted copy constructor.
A timestamp is a plain value, so it may be copied.
Definition at line 2364 of file deprecated.h.
timestamp()
| default |
Defaulted move constructor.
Equivalent to the copy, since the value is trivially copyable.
Definition at line 2372 of file deprecated.h.
Reference timestamp.
timestamp()
| noexcept |
Constructs a timestamp with the current time.
Reads the system clock, as stopwatch::start() does; without a clock, the value remains zero.
Reads the system clock into the stored value, with read_clock(), the same clock as stopwatch; without a clock, the value remains zero.
Declaration at line 2345 of file deprecated.h, definition at line 100 of file deprecated.cpp.
References micro_os_plus::micro_test_plus::detail::read_clock and value_.
Referenced by timestamp, timestamp, ~timestamp, operator= and operator=.
Public Destructor
~timestamp()
| default |
Defaulted destructor.
No resources are owned, so there is nothing to release.
Definition at line 2405 of file deprecated.h.
Reference timestamp.
Public Operators
operator=()
| default |
Defaulted copy assignment operator.
A timestamp is a plain value, so it may be assigned.
- Returns
A reference to the current object.
Definition at line 2383 of file deprecated.h.
Reference timestamp.
operator=()
| default |
Defaulted move assignment operator.
Equivalent to the copy assignment, since the value is trivially copyable.
- Returns
A reference to the current object.
Definition at line 2396 of file deprecated.h.
Reference timestamp.
Public Member Functions
has_clock()
| inline nodiscard noexcept |
Checks whether the value is a clock reading.
The value is not a reading if both its members are zero.
- Parameters
None.
- Return Values
-
true At least one of the members is not zero.
false Both members are zero.
Returns true if either the seconds or the nanoseconds member is not zero.
Declaration at line 2419 of file deprecated.h, definition at line 1309 of file deprecated-inlines.h.
References has_clock and value_.
Referenced by has_clock.
value()
| inline nodiscard noexcept |
Returns the stored time.
- Parameters
None.
- Returns
A constant reference to the stored timespec.
The returned reference is valid as long as the object exists.
Declaration at line 2439 of file deprecated.h, definition at line 1334 of file deprecated-inlines.h.
value()
| inline nodiscard noexcept |
Returns the stored time, for modification.
- Parameters
None.
- Returns
A reference to the stored timespec.
The caller may modify the stored time through the returned reference.
Declaration at line 2429 of file deprecated.h, definition at line 1322 of file deprecated-inlines.h.
The documentation for this class was generated from the following files:
Generated via doxygen2docusaurus 2.2.8 by Doxygen 1.18.0.