src/corosio/src/timer.cpp
100.0% Lines (19/19)
100.0% List of functions (8/8)
33.3% Branches (2/6)
Functions (8)
Function
Calls
Lines
Branches
Blocks
boost::corosio::timer::~timer()
:16
15098x
100.0%
–
100.0%
boost::corosio::timer::timer(boost::capy::execution_context&)
:18
15096x
100.0%
–
100.0%
boost::corosio::timer::timer(boost::capy::execution_context&, std::__1::chrono::time_point<std::__1::chrono::steady_clock, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l>>>)
:23
2x
100.0%
25.0%
50.0%
boost::corosio::timer::timer(boost::corosio::timer&&)
:28
4x
100.0%
–
100.0%
boost::corosio::timer::operator=(boost::corosio::timer&&)
:31
4x
100.0%
50.0%
100.0%
boost::corosio::timer::do_cancel()
:39
700x
100.0%
–
100.0%
boost::corosio::timer::do_cancel_one()
:45
2x
100.0%
–
100.0%
boost::corosio::timer::do_update_expiry()
:51
6x
100.0%
–
100.0%
| Line | Branch | TLA | Hits | Source Code |
|---|---|---|---|---|
| 1 | // | |||
| 2 | // Copyright (c) 2025 Vinnie Falco ([email protected]) | |||
| 3 | // Copyright (c) 2026 Steve Gerbino | |||
| 4 | // | |||
| 5 | // Distributed under the Boost Software License, Version 1.0. (See accompanying | |||
| 6 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | |||
| 7 | // | |||
| 8 | // Official repository: https://github.com/cppalliance/corosio | |||
| 9 | // | |||
| 10 | ||||
| 11 | #include <boost/corosio/timer.hpp> | |||
| 12 | #include <boost/corosio/detail/timer_service.hpp> | |||
| 13 | ||||
| 14 | namespace boost::corosio { | |||
| 15 | ||||
| 16 | 15098x | timer::~timer() = default; | ||
| 17 | ||||
| 18 | 15096x | timer::timer(capy::execution_context& ctx) | ||
| 19 | 7556x | : io_timer(handle(ctx, detail::timer_service_direct(ctx))) | ||
| 20 | 15096x | { | ||
| 21 | 15096x | } | ||
| 22 | ||||
| 23 | 2x | timer::timer(capy::execution_context& ctx, time_point t) : timer(ctx) | ||
| 24 | { | |||
| 25 |
1/4✗ Branch 0 not taken.
✗ Branch 1 not taken.
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
|
2x | expires_at(t); | |
| 26 | 2x | } | ||
| 27 | ||||
| 28 | 4x | timer::timer(timer&& other) noexcept : io_timer(std::move(other)) {} | ||
| 29 | ||||
| 30 | timer& | |||
| 31 | 4x | timer::operator=(timer&& other) noexcept | ||
| 32 | { | |||
| 33 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 4 times.
|
4x | if (this != &other) | |
| 34 | 4x | h_ = std::move(other.h_); | ||
| 35 | 4x | return *this; | ||
| 36 | } | |||
| 37 | ||||
| 38 | std::size_t | |||
| 39 | 700x | timer::do_cancel() | ||
| 40 | { | |||
| 41 | 700x | return detail::timer_service_cancel(get()); | ||
| 42 | } | |||
| 43 | ||||
| 44 | std::size_t | |||
| 45 | 2x | timer::do_cancel_one() | ||
| 46 | { | |||
| 47 | 2x | return detail::timer_service_cancel_one(get()); | ||
| 48 | } | |||
| 49 | ||||
| 50 | std::size_t | |||
| 51 | 6x | timer::do_update_expiry() | ||
| 52 | { | |||
| 53 | 6x | return detail::timer_service_update_expiry(get()); | ||
| 54 | } | |||
| 55 | ||||
| 56 | } // namespace boost::corosio | |||
| 57 |