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

STEllAR-GROUP / hpx / #856

28 Dec 2022 02:00AM UTC coverage: 86.602% (+0.05%) from 86.55%
#856

push

StellarBot
Merge #6119

6119: Update CMakeLists.txt r=hkaiser a=khuck

updating the default APEX version


Co-authored-by: Kevin Huck <khuck@cs.uoregon.edu>

174566 of 201573 relevant lines covered (86.6%)

1876093.78 hits per line

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

86.15
/libs/core/runtime_configuration/src/static_factory_data.cpp
1
//  Copyright (c) 2005-2014 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/runtime_configuration/static_factory_data.hpp>
8

9
#include <map>
10
#include <string>
11
#include <utility>
12
#include <vector>
13

14
namespace hpx::components {
15

16
    bool& get_initial_static_loading() noexcept
33,090✔
17
    {
18
        static bool initial_static_loading = true;
19
        return initial_static_loading;
33,090✔
20
    }
21

22
    ///////////////////////////////////////////////////////////////////////////
23
    // There is no need to protect these global from thread concurrent access
24
    // as they are access during early startup only.
25
    std::vector<static_factory_load_data_type>& get_static_module_data()
2,010✔
26
    {
27
        static std::vector<static_factory_load_data_type>
2,010✔
28
            global_module_init_data;
1,160✔
29
        return global_module_init_data;
2,010✔
30
    }
31

32
    void init_registry_module(static_factory_load_data_type const& data)
1,416✔
33
    {
34
        if (get_initial_static_loading())
1,416✔
35
        {
36
            get_static_module_data().push_back(data);
1,416✔
37
        }
1,416✔
38
    }
1,416✔
39

40
    ///////////////////////////////////////////////////////////////////////////
41
    std::map<std::string, util::plugin::get_plugins_list_type>&
42
    get_static_factory_data()
47,224✔
43
    {
44
        static std::map<std::string, util::plugin::get_plugins_list_type>
47,224✔
45
            global_factory_init_data;
1,160✔
46
        return global_factory_init_data;
47,224✔
47
    }
48

49
    void init_registry_factory(static_factory_load_data_type const& data)
30,987✔
50
    {
51
        if (get_initial_static_loading())
30,987✔
52
        {
53
            get_static_factory_data().insert(
61,974✔
54
                std::make_pair(data.name, data.get_factory));
30,987✔
55
        }
30,987✔
56
    }
30,987✔
57

58
    bool get_static_factory(
16,237✔
59
        std::string const& instance, util::plugin::get_plugins_list_type& f)
60
    {
61
        using map_type =
62
            std::map<std::string, util::plugin::get_plugins_list_type>;
63

64
        map_type const& m = get_static_factory_data();
16,237✔
65
        map_type::const_iterator it = m.find(instance);
16,237✔
66
        if (it == m.end())
16,237✔
67
            return false;
×
68

69
        f = it->second;
16,237✔
70
        return true;
16,237✔
71
    }
16,237✔
72

73
    ///////////////////////////////////////////////////////////////////////////
74
    std::map<std::string, util::plugin::get_plugins_list_type>&
75
    get_static_commandline_data()
846✔
76
    {
77
        static std::map<std::string, util::plugin::get_plugins_list_type>
846✔
78
            global_commandline_init_data;
489✔
79
        return global_commandline_init_data;
846✔
80
    }
81

82
    void init_registry_commandline(static_factory_load_data_type const& data)
×
83
    {
84
        if (get_initial_static_loading())
×
85
        {
86
            get_static_commandline_data().insert(
×
87
                std::make_pair(data.name, data.get_factory));
×
88
        }
×
89
    }
×
90

91
    bool get_static_commandline(
846✔
92
        std::string const& instance, util::plugin::get_plugins_list_type& f)
93
    {
94
        using map_type =
95
            std::map<std::string, util::plugin::get_plugins_list_type>;
96

97
        map_type const& m = get_static_commandline_data();
846✔
98
        map_type::const_iterator it = m.find(instance);
846✔
99
        if (it == m.end())
846✔
100
            return false;
846✔
101

102
        f = it->second;
×
103
        return true;
×
104
    }
846✔
105

106
    ///////////////////////////////////////////////////////////////////////////
107
    std::map<std::string, util::plugin::get_plugins_list_type>&
108
    get_static_startup_shutdown_data()
939✔
109
    {
110
        static std::map<std::string, util::plugin::get_plugins_list_type>
939✔
111
            global_startup_shutdown_init_data;
491✔
112
        return global_startup_shutdown_init_data;
939✔
113
    }
114

115
    void init_registry_startup_shutdown(
93✔
116
        static_factory_load_data_type const& data)
117
    {
118
        if (get_initial_static_loading())
93✔
119
        {
120
            get_static_startup_shutdown_data().insert(
186✔
121
                std::make_pair(data.name, data.get_factory));
93✔
122
        }
93✔
123
    }
93✔
124

125
    bool get_static_startup_shutdown(
846✔
126
        std::string const& instance, util::plugin::get_plugins_list_type& f)
127
    {
128
        using map_type =
129
            std::map<std::string, util::plugin::get_plugins_list_type>;
130

131
        map_type const& m = get_static_startup_shutdown_data();
846✔
132
        map_type::const_iterator it = m.find(instance);
846✔
133
        if (it == m.end())
846✔
134
            return false;
755✔
135

136
        f = it->second;
91✔
137
        return true;
91✔
138
    }
846✔
139
}    // namespace hpx::components
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

© 2025 Coveralls, Inc