• 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

0.0
/components/component_storage/src/server/component_storage_server.cpp
1
//  Copyright (c) 2015 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/components/component_storage/server/component_storage.hpp>
9
#include <hpx/modules/errors.hpp>
10
#include <hpx/runtime_distributed/find_localities.hpp>
11

12
#include <vector>
13

14
#include <hpx/config/warnings_prefix.hpp>
×
15

×
16
namespace hpx { namespace components { namespace server {
17
    component_storage::component_storage()
×
18
      : data_(container_layout(find_all_localities()))
19
    {
20
    }
×
21

22
    ///////////////////////////////////////////////////////////////////////////
23
    naming::gid_type component_storage::migrate_to_here(
24
        std::vector<char> const& data, hpx::id_type id,
25
        naming::address const& current_lva)
×
26
    {
27
        naming::gid_type gid(naming::detail::get_stripped_gid(id.get_gid()));
28
        data_[gid] = data;
29

×
30
        // rebind the object to this storage locality
×
31
        naming::address addr(current_lva);
32
        addr.address_ = nullptr;    // invalidate lva
×
33
        if (!agas::bind(launch::sync, gid, addr, this->gid_))
34
        {
35
            HPX_THROW_EXCEPTION(hpx::error::duplicate_component_address,
36
                "component_storage::migrate_to_here",
37
                "failed to rebind id {} to storage locality: {}", id, gid_);
38
            return naming::invalid_gid;
39
        }
40

41
        id.make_unmanaged();    // we can now release the object
42
        return naming::invalid_gid;
×
43
    }
44

45
    std::vector<char> component_storage::migrate_from_here(
46
        naming::gid_type const& id)
47
    {
×
48
        // return the stored data and erase it from the map
49
        return data_.get_value(
50
            launch::sync, naming::detail::get_stripped_gid(id), true);
51
    }
×
52
}}}    // namespace hpx::components::server
53

54
HPX_REGISTER_UNORDERED_MAP(
55
    hpx::naming::gid_type, hpx_component_storage_data_type)
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