Coverage Report

Created: 2025-07-11 06:33

/src/bag/api/bag_vrnode.h
Line
Count
Source (jump to first uncovered line)
1
#ifndef BAG_VRNODE_H
2
#define BAG_VRNODE_H
3
4
#include "bag_config.h"
5
#include "bag_deleteh5dataset.h"
6
#include "bag_fordec.h"
7
#include "bag_layer.h"
8
9
#include <memory>
10
11
12
namespace BAG {
13
14
#ifdef _MSC_VER
15
#pragma warning(push)
16
#pragma warning(disable: 4251)  // std classes do not have DLL-interface when exporting
17
#endif
18
19
//! Interface for the variable resolution node layer.
20
class BAG_API VRNode final : public Layer
21
{
22
public:
23
    VRNode(Dataset& dataset,
24
           VRNodeDescriptor& descriptor,
25
           std::unique_ptr<::H5::DataSet, DeleteH5dataSet> pH5dataSet);
26
27
    VRNode(const VRNode&) = delete;
28
    VRNode(VRNode&&) = delete;
29
30
    VRNode& operator=(const VRNode&) = delete;
31
    VRNode& operator=(VRNode&&) = delete;
32
33
0
    bool operator==(const VRNode &rhs) const noexcept {
34
0
        return m_pH5dataSet == rhs.m_pH5dataSet;
35
0
    }
36
37
0
    bool operator!=(const VRNode &rhs) const noexcept {
38
0
        return !(rhs == *this);
39
0
    }
40
41
    std::shared_ptr<VRNodeDescriptor> getDescriptor() & noexcept;
42
    std::shared_ptr<const VRNodeDescriptor> getDescriptor() const & noexcept;
43
44
protected:
45
    static std::shared_ptr<VRNode> create(Dataset& dataset,
46
        uint64_t chunkSize, int compressionLevel);
47
48
    static std::shared_ptr<VRNode> open(Dataset& dataset,
49
        VRNodeDescriptor& descriptor);
50
51
private:
52
    static std::unique_ptr<::H5::DataSet, DeleteH5dataSet>
53
        createH5dataSet(const Dataset& dataset,
54
            const VRNodeDescriptor& descriptor);
55
56
    UInt8Array readProxy(uint32_t rowStart,
57
        uint32_t columnStart, uint32_t rowEnd, uint32_t columnEnd) const override;
58
59
    void writeProxy(uint32_t rowStart, uint32_t columnStart, uint32_t rowEnd,
60
        uint32_t columnEnd, const uint8_t *buffer) override;
61
62
    void writeAttributesProxy() const override;
63
64
    //! The HDF5 DataSet this layer wraps.
65
    std::unique_ptr<H5::DataSet, DeleteH5dataSet> m_pH5dataSet;
66
67
    friend Dataset;
68
};
69
70
#ifdef _MSC_VER
71
#pragma warning(pop)
72
#endif
73
74
}  // namespace BAG
75
76
#endif  // BAG_VRNODE_H
77