Skip to main content

timings-inlines.h File

C++ header file with inline implementations for the µTest++ timing utilities. More...

Namespaces Index

namespacemicro_os_plus

The primary namespace for the µOS++ framework. More...

namespacemicro_test_plus

Primary namespace for the µTest++ testing framework. More...

namespacedetail

Internal implementation details for the µTest++ framework. More...

Description

C++ header file with inline implementations for the µTest++ timing utilities.

This header provides the inline method bodies for the timestamp and timestamps classes, separated from the class declarations in timings.h to enforce the project convention that declarations reside in headers and implementations reside in inline files.

All definitions reside within the micro_os_plus::micro_test_plus namespace, ensuring clear separation from user code and minimising the risk of naming conflicts.

File Listing

The file content with the documentation metadata removed is:

1/*
2 * This file is part of the µOS++ project (https://micro-os-plus.github.io/).
3 * Copyright (c) 2021-2026 Liviu Ionescu. All rights reserved.
4 *
5 * Permission to use, copy, modify, and/or distribute this software for any
6 * purpose is hereby granted, under the terms of the MIT license.
7 *
8 * If a copy of the license was not distributed with this file, it can be
9 * obtained from https://opensource.org/licenses/mit.
10 */
11
12// ----------------------------------------------------------------------------
13
29
30#ifndef MICRO_TEST_PLUS_TIMINGS_INLINES_H_
31#define MICRO_TEST_PLUS_TIMINGS_INLINES_H_
32
33// ----------------------------------------------------------------------------
34
35#ifdef __cplusplus
36
37// ----------------------------------------------------------------------------
38
39#if defined(__GNUC__)
40#pragma GCC diagnostic push
41#if defined(__clang__)
42#pragma clang diagnostic ignored "-Wc++98-compat"
43#pragma clang diagnostic ignored "-Wpre-c++17-compat"
44#endif
45#endif
46
47// ============================================================================
48
50{
51 // ==========================================================================
52
57 inline timestamp::timestamp (const timespec& ts) noexcept : value_{ ts }
58 {
59 }
60
65 inline timespec&
66 timestamp::value () noexcept
67 {
68 return value_;
69 }
70
75 inline const timespec&
76 timestamp::value () const noexcept
77 {
78 return value_;
79 }
80
81 // ==========================================================================
82
88 inline bool
89 timestamps::has_begin () const noexcept
90 {
91 return begin_time_.has_value ();
92 }
93
99 inline bool
100 timestamps::has_end () const noexcept
101 {
102 return end_time_.has_value ();
103 }
104
105 // --------------------------------------------------------------------------
106} // namespace micro_os_plus::micro_test_plus::detail
107
108#if defined(__GNUC__)
109#pragma GCC diagnostic pop
110#endif
111
112// ----------------------------------------------------------------------------
113
114#endif // __cplusplus
115
116// ----------------------------------------------------------------------------
117
118#endif // MICRO_TEST_PLUS_TIMINGS_INLINES_H_
119
120// ----------------------------------------------------------------------------

Generated via doxygen2docusaurus 2.2.0 by Doxygen 1.17.0.