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_OS_PLUS_MICRO_TEST_PLUS_INLINES_TIMINGS_INLINES_H_
31#define MICRO_OS_PLUS_MICRO_TEST_PLUS_INLINES_TIMINGS_INLINES_H_
32
33// ----------------------------------------------------------------------------
34
35#if defined(__cplusplus)
36
37// ----------------------------------------------------------------------------
38
39#if defined(__GNUC__)
40#pragma GCC diagnostic push
41
42#if defined(__clang__)
43#pragma clang diagnostic ignored "-Wc++98-compat"
44#pragma clang diagnostic ignored "-Wpre-c++17-compat"
45#endif // defined(__clang__)
46#endif // defined(__GNUC__)
47
48// ============================================================================
49
51{
52 // ==========================================================================
53
58 inline timestamp::timestamp (const timespec& ts) noexcept : value_{ ts }
59 {
60 }
61
66 inline timespec&
67 timestamp::value () noexcept
68 {
69 return value_;
70 }
71
76 inline const timespec&
77 timestamp::value () const noexcept
78 {
79 return value_;
80 }
81
82 // ==========================================================================
83
89 inline bool
90 timestamps::has_begin () const noexcept
91 {
92 return begin_time_.has_value ();
93 }
94
100 inline bool
101 timestamps::has_end () const noexcept
102 {
103 return end_time_.has_value ();
104 }
105
106 // --------------------------------------------------------------------------
107} // namespace micro_os_plus::micro_test_plus::detail
108
109#if defined(__GNUC__)
110#pragma GCC diagnostic pop
111#endif // defined(__GNUC__)
112
113// ----------------------------------------------------------------------------
114
115#endif // defined(__cplusplus)
116
117// ----------------------------------------------------------------------------
118
119#endif // MICRO_OS_PLUS_MICRO_TEST_PLUS_INLINES_TIMINGS_INLINES_H_
120
121// ----------------------------------------------------------------------------

Generated via doxygen2docusaurus 2.2.2 by Doxygen 1.17.0.