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

afxres / binary-cxx / 17798628631

17 Sep 2025 01:05PM UTC coverage: 99.298% (-0.05%) from 99.344%
17798628631

push

github

afxres
New benchmarks for experimental converters

3 of 3 new or added lines in 1 file covered. (100.0%)

2 existing lines in 1 file now uncovered.

1131 of 1139 relevant lines covered (99.3%)

92.38 hits per line

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

91.67
/code/binary/include/binary/components/TupleObjectConverter.hpp
1
#ifndef BINARY_COMPONENTS_TUPLEOBJECTCONVERTER_HPP
2
#define BINARY_COMPONENTS_TUPLEOBJECTCONVERTER_HPP
3

4
#include "binary/Converter.hpp"
5
#include "binary/internal/Define.hpp"
6
#include "binary/internal/Module.hpp"
7

8
namespace binary::components {
9
template <typename T>
10
class TupleObjectConverter : public Converter<T> {
11
public:
12
    using EncodeFunction = std::function<void(Allocator&, const T&)>;
13
    using DecodeFunction = std::function<void(T&, std::span<const std::byte>&)>;
14

15
    struct MemberInfo {
16
        size_t Length;
17
        EncodeFunction Encode;
18
        EncodeFunction EncodeAuto;
19
        DecodeFunction Decode;
20
        DecodeFunction DecodeAuto;
21
    };
22

23
    TupleObjectConverter(std::vector<MemberInfo>&& record)
12✔
24
        : Converter<T>(::binary::internal::GetConverterLength(record | std::views::transform([](const auto& info) { return info.Length; })))
33✔
25
        , record(std::move(record)) {}
24✔
26

27
    BINARY_DEFINE_OVERRIDE_ENCODE_METHOD(T) {
9✔
28
        for (const auto& info : this->record) {
24✔
29
            info.Encode(allocator, item);
15✔
30
        }
31
    }
9✔
32

33
    BINARY_DEFINE_OVERRIDE_ENCODE_AUTO_METHOD(T) {
2✔
34
        for (const auto& info : this->record) {
6✔
35
            info.EncodeAuto(allocator, item);
4✔
36
        }
37
    }
2✔
38

39
    BINARY_DEFINE_OVERRIDE_DECODE_METHOD(T) {
9✔
40
        T result{};
9✔
41
        std::span<const std::byte> copy = span;
9✔
42
        for (const auto& info : this->record) {
24✔
43
            info.Decode(result, copy);
15✔
44
        }
45
        return result;
14✔
UNCOV
46
    }
×
47

48
    BINARY_DEFINE_OVERRIDE_DECODE_AUTO_METHOD(T) {
2✔
49
        T result{};
2✔
50
        for (const auto& info : this->record) {
6✔
51
            info.DecodeAuto(result, span);
4✔
52
        }
53
        return result;
2✔
UNCOV
54
    }
×
55

56
private:
57
    std::vector<MemberInfo> record;
58
};
59
}
60

61
#endif
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