• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

STEllAR-GROUP / hpx / #853

19 Dec 2022 01:01AM UTC coverage: 86.287% (+0.4%) from 85.912%
#853

push

StellarBot
Merge #6109

6109: Modernize serialization module r=hkaiser a=hkaiser

- flyby separate serialization of Boost types

working towards https://github.com/STEllAR-GROUP/hpx/issues/5497

Co-authored-by: Hartmut Kaiser <hartmut.kaiser@gmail.com>

53 of 53 new or added lines in 6 files covered. (100.0%)

173939 of 201582 relevant lines covered (86.29%)

1931657.12 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/libs/full/performance_counters/src/manage_counter.cpp
1
//  Copyright (c) 2007-2017 Hartmut Kaiser
2
//
3
//  SPDX-License-Identifier: BSL-1.0
4
//  Distributed under the Boost Software License, Version 1.0. (See accompanying
5
//  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6

7
#include <hpx/config.hpp>
8
#include <hpx/assert.hpp>
9
#include <hpx/async_distributed/continuation.hpp>
10
#include <hpx/functional/bind_front.hpp>
11
#include <hpx/modules/errors.hpp>
12
#include <hpx/modules/runtime_local.hpp>
13
#include <hpx/performance_counters/counter_creators.hpp>
14
#include <hpx/performance_counters/counters.hpp>
15
#include <hpx/performance_counters/manage_counter.hpp>
16
#include <hpx/version.hpp>
17

18
#include <memory>
19

20
namespace hpx { namespace performance_counters {
21
    struct manage_counter
22
    {
23
        manage_counter()
×
24
          : counter_(hpx::invalid_id)
×
25
        {
26
        }
×
27

28
        ~manage_counter()
×
29
        {
30
            uninstall();
×
31
        }
×
32

33
        // install an (existing) counter
34
        counter_status install(hpx::id_type const& id, counter_info const& info,
35
            error_code& ec = throws);
36

37
        // uninstall the counter
38
        void uninstall();
39

40
    private:
41
        counter_info info_;
42
        hpx::id_type counter_;
43
    };
44

45
    counter_status manage_counter::install(
×
46
        hpx::id_type const& id, counter_info const& info, error_code& ec)
47
    {
48
        if (counter_ != hpx::invalid_id)
×
49
        {
50
            HPX_THROWS_IF(ec, hpx::error::invalid_status,
×
51
                "manage_counter::install",
52
                "counter has been already installed");
53
            return counter_status::invalid_data;
×
54
        }
55

56
        info_ = info;
×
57
        counter_ = id;
×
58

59
        return detail::add_counter(id, info_, ec);
×
60
    }
×
61

62
    void manage_counter::uninstall()
×
63
    {
64
        if (counter_)
×
65
        {
66
            error_code ec(throwmode::lightweight);
×
67
            detail::remove_counter(info_, counter_, ec);
×
68
            counter_ = hpx::invalid_id;
×
69
        }
×
70
    }
×
71

72
    ///////////////////////////////////////////////////////////////////////////
73
    static void counter_shutdown(std::shared_ptr<manage_counter> const& p)
×
74
    {
75
        HPX_ASSERT(p);
×
76
        p->uninstall();
×
77
    }
×
78

79
    void install_counter(
×
80
        hpx::id_type const& id, counter_info const& info, error_code& ec)
81
    {
82
        std::shared_ptr<manage_counter> p = std::make_shared<manage_counter>();
×
83

84
        // Install the counter instance.
85
        p->install(id, info, ec);
×
86

87
        // Register the shutdown function which will clean up this counter.
88
        get_runtime().add_shutdown_function(
×
89
            hpx::bind_front(&counter_shutdown, p));
×
90
    }
×
91
}}    // namespace hpx::performance_counters
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc