• 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
/libs/core/serialization/include/hpx/serialization/unordered_map.hpp
1
//  Copyright (c) 2015 Anton Bikineev
2
//  Copyright (c) 2016-2025 Hartmut Kaiser
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
#pragma once
9

10
#include <hpx/config.hpp>
11
#include <hpx/serialization/map.hpp>
12
#include <hpx/serialization/serialization_fwd.hpp>
13
#include <hpx/serialization/serialize.hpp>
14

15
#include <cstdint>
16
#include <unordered_map>
17
#include <utility>
18

19
namespace hpx::serialization {
20

21
    HPX_CXX_EXPORT template <typename Key, typename Value, typename Hash,
22
        typename KeyEqual, typename Alloc>
23
    void serialize(input_archive& ar,
×
24
        std::unordered_map<Key, Value, Hash, KeyEqual, Alloc>& t, unsigned)
25
    {
26
        using container_type =
27
            std::unordered_map<Key, Value, Hash, KeyEqual, Alloc>;
28

29
        using size_type = typename container_type::size_type;
30
        using value_type = typename container_type::value_type;
31

32
        size_type size;
33
        ar >> size;    //-V128
34

35
        t.clear();
36
        for (size_type i = 0; i < size; ++i)
×
37
        {
38
            value_type v;
×
39
            ar >> v;
40
            t.insert(t.end(), HPX_MOVE(v));
41
        }
42
    }
×
43

44
    HPX_CXX_EXPORT template <typename Key, typename Value, typename Hash,
45
        typename KeyEqual, typename Alloc>
46
    void serialize(output_archive& ar,
×
47
        std::unordered_map<Key, Value, Hash, KeyEqual, Alloc> const& t,
48
        unsigned)
49
    {
50
        std::uint64_t const size = t.size();
51
        ar << size;
52
        if (size == 0)
×
53
            return;
54

55
        for (auto const& val : t)
×
56
        {
57
            ar << val;
58
        }
59
    }
60
}    // namespace hpx::serialization
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