Coverage Report

Created: 2025-07-11 06:33

/src/bag/api/bag_vrnodedescriptor.h
Line
Count
Source (jump to first uncovered line)
1
#ifndef BAG_VRNODEDESCRIPTOR_H
2
#define BAG_VRNODEDESCRIPTOR_H
3
4
#include "bag_config.h"
5
#include "bag_fordec.h"
6
#include "bag_layerdescriptor.h"
7
8
9
namespace BAG {
10
11
//! Describe the variable resolution node.
12
class BAG_API VRNodeDescriptor final : public LayerDescriptor
13
{
14
public:
15
    VRNodeDescriptor(const VRNodeDescriptor&) = delete;
16
    VRNodeDescriptor(VRNodeDescriptor&&) = delete;
17
18
    VRNodeDescriptor& operator=(const VRNodeDescriptor&) = delete;
19
    VRNodeDescriptor& operator=(VRNodeDescriptor&&) = delete;
20
21
0
    bool operator==(const VRNodeDescriptor &rhs) const noexcept {
22
0
        return m_minHypStrength == rhs.m_minHypStrength &&
23
0
               m_maxHypStrength == rhs.m_maxHypStrength &&
24
0
               m_minNumHypotheses == rhs.m_minNumHypotheses &&
25
0
               m_maxNumHypotheses == rhs.m_maxNumHypotheses &&
26
0
               m_minNSamples == rhs.m_minNSamples &&
27
0
               m_maxNSamples == rhs.m_maxNSamples;
28
0
    }
29
30
0
    bool operator!=(const VRNodeDescriptor &rhs) const noexcept {
31
0
        return !(rhs == *this);
32
0
    }
33
34
    std::tuple<float, float> getMinMaxHypStrength() const noexcept;
35
    std::tuple<uint32_t, uint32_t> getMinMaxNSamples() const noexcept;
36
    std::tuple<uint32_t, uint32_t> getMinMaxNumHypotheses() const noexcept;
37
38
    VRNodeDescriptor& setMinMaxHypStrength(float minHypStrength,
39
        float maxHypStrength) & noexcept;
40
    VRNodeDescriptor& setMinMaxNSamples(uint32_t minNSamples,
41
        uint32_t maxNSamples) & noexcept;
42
    VRNodeDescriptor& setMinMaxNumHypotheses(uint32_t minNumHypotheses,
43
        uint32_t maxNumHypotheses) & noexcept;
44
45
protected:
46
    VRNodeDescriptor(uint32_t id, uint64_t chunkSize,
47
        int compressionLevel);
48
    explicit VRNodeDescriptor(const Dataset& dataset);
49
50
    static std::shared_ptr<VRNodeDescriptor> create(const Dataset& dataset,
51
        uint64_t chunkSize, int compressionLevel);
52
53
    static std::shared_ptr<VRNodeDescriptor> open(const Dataset& dataset);
54
55
private:
56
    DataType getDataTypeProxy() const noexcept override;
57
    uint8_t getElementSizeProxy() const noexcept override;
58
59
    //! The minimum hypotheses strength.
60
    float m_minHypStrength = std::numeric_limits<float>::max();
61
    //! The maximum hypotheses strength.
62
    float m_maxHypStrength = std::numeric_limits<float>::lowest();
63
    //! The minimum number of hypotheses.
64
    uint32_t m_minNumHypotheses = std::numeric_limits<uint32_t>::max();
65
    //! The maximum number of hypotheses.
66
    uint32_t m_maxNumHypotheses = std::numeric_limits<uint32_t>::lowest();
67
    //! The minimum number of samples..
68
    uint32_t m_minNSamples = std::numeric_limits<uint32_t>::max();
69
    //! The maximum number of samples.
70
    uint32_t m_maxNSamples = std::numeric_limits<uint32_t>::lowest();
71
72
    friend Dataset;
73
    friend VRNode;
74
};
75
76
}  // namespace BAG
77
78
#endif  // BAG_VRNODEDESCRIPTOR_H
79