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

STEllAR-GROUP / hpx / #882

31 Aug 2023 07:44PM UTC coverage: 41.798% (-44.7%) from 86.546%
#882

push

19442 of 46514 relevant lines covered (41.8%)

126375.38 hits per line

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

95.45
/components/iostreams/src/component_module.cpp
1
//  Copyright (c) 2007-2016 Hartmut Kaiser
2
//  Copyright (c)      2011 Bryce Lelbach
3
//
4
//  SPDX-License-Identifier: BSL-1.0
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
#include <hpx/config.hpp>
9
#include <hpx/actions_base/basic_action.hpp>
10
#include <hpx/async_distributed/transfer_continuation_action.hpp>
11
#include <hpx/components_base/component_startup_shutdown.hpp>
12
#include <hpx/components_base/component_type.hpp>
13
#include <hpx/components_base/server/component.hpp>
14
#include <hpx/modules/functional.hpp>
15
#include <hpx/modules/runtime_local.hpp>
16
#include <hpx/runtime_components/component_factory.hpp>
17

18
#include <hpx/components/iostreams/ostream.hpp>
19
#include <hpx/components/iostreams/server/output_stream.hpp>
20
#include <hpx/components/iostreams/standard_streams.hpp>
21

22
///////////////////////////////////////////////////////////////////////////////
23
HPX_REGISTER_COMPONENT_MODULE()
24

×
25
typedef hpx::iostreams::server::output_stream ostream_type;
26

27
HPX_REGISTER_COMPONENT(hpx::components::component<ostream_type>,
28
    output_stream_factory, hpx::components::factory_state::enabled)
90✔
29
HPX_DEFINE_GET_COMPONENT_TYPE(ostream_type)
30

31
///////////////////////////////////////////////////////////////////////////////
197✔
32
HPX_REGISTER_ACTION_ID(ostream_type::write_async_action,
33
    output_stream_write_async_action,
34
    hpx::actions::output_stream_write_async_action_id)
51✔
35

36
HPX_REGISTER_ACTION_ID(ostream_type::write_sync_action,
37
    output_stream_write_sync_action,
38
    hpx::actions::output_stream_write_sync_action_id)
39

51✔
40
///////////////////////////////////////////////////////////////////////////////
41
// Register a startup function which will be called as a HPX-thread during
42
// runtime startup.
43
namespace hpx { namespace iostreams { namespace detail {
44
    ///////////////////////////////////////////////////////////////////////////
45
    void register_ostreams()
46
    {
47
        hpx::cout.initialize(iostreams::detail::cout_tag());
48
        hpx::cerr.initialize(iostreams::detail::cerr_tag());
49
        hpx::consolestream.initialize(iostreams::detail::consolestream_tag());
50
    }
15✔
51

52
    void unregister_ostreams()
15✔
53
    {
15✔
54
        hpx::cout.uninitialize(iostreams::detail::cout_tag());
15✔
55
        hpx::cerr.uninitialize(iostreams::detail::cerr_tag());
15✔
56
        hpx::consolestream.uninitialize(iostreams::detail::consolestream_tag());
57
    }
15✔
58

59
    ///////////////////////////////////////////////////////////////////////////
15✔
60
    bool get_startup(startup_function_type& startup_func, bool& pre_startup)
15✔
61
    {
15✔
62
        // return our startup-function
15✔
63
        startup_func = register_ostreams;    // function to run during startup
64
        pre_startup = true;                  // run as pre-startup function
65
        return true;
15✔
66
    }
67

68
    bool get_shutdown(shutdown_function_type& shutdown_func, bool& pre_shutdown)
69
    {
15✔
70
        // return our startup-function
15✔
71
        shutdown_func =
72
            unregister_ostreams;    // function to run during startup
73
        pre_shutdown = false;       // run as pre-startup function
15✔
74
        return true;
75
    }
76
}}}    // namespace hpx::iostreams::detail
77

15✔
78
// Note that this macro can be used not more than once in one module.
15✔
79
HPX_REGISTER_STARTUP_SHUTDOWN_MODULE(
80
    hpx::iostreams::detail::get_startup, hpx::iostreams::detail::get_shutdown)
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