Coverage Report

Created: 2026-02-26 06:47

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/bag/api/bag_simplelayerdescriptor.h
Line
Count
Source
1
#ifndef BAG_SIMPLELAYERDESCRIPTOR_H
2
#define BAG_SIMPLELAYERDESCRIPTOR_H
3
4
#include "bag_config.h"
5
#include "bag_fordec.h"
6
#include "bag_layerdescriptor.h"
7
#include "bag_types.h"
8
9
#include <memory>
10
11
12
namespace BAG {
13
14
//! Describe a simple layer.
15
class BAG_API SimpleLayerDescriptor final : public LayerDescriptor
16
{
17
public:
18
    static std::shared_ptr<SimpleLayerDescriptor> create(const Dataset& dataset,
19
        LayerType type, uint32_t rows, uint32_t cols,
20
        uint64_t chunkSize, int compressionLevel);
21
22
    static std::shared_ptr<SimpleLayerDescriptor> open(const Dataset& dataset,
23
        LayerType type, uint32_t rows, uint32_t cols);
24
25
    SimpleLayerDescriptor(const SimpleLayerDescriptor&) = delete;
26
    SimpleLayerDescriptor(SimpleLayerDescriptor&&) = delete;
27
28
    SimpleLayerDescriptor& operator=(const SimpleLayerDescriptor&) = delete;
29
    SimpleLayerDescriptor& operator=(SimpleLayerDescriptor&&) = delete;
30
31
0
    bool operator==(const SimpleLayerDescriptor &rhs) const noexcept {
32
0
        return m_elementSize == rhs.m_elementSize;
33
0
    }
34
35
0
    bool operator!=(const SimpleLayerDescriptor &rhs) const noexcept {
36
0
        return !(rhs == *this);
37
0
    }
38
39
protected:
40
    SimpleLayerDescriptor(uint32_t id, LayerType type,
41
        uint32_t rows, uint32_t cols, uint64_t chunkSize,
42
        int compressionLevel);
43
    SimpleLayerDescriptor(const Dataset& dataset, LayerType type,
44
        uint32_t rows, uint32_t cols);
45
46
private:
47
    DataType getDataTypeProxy() const noexcept override;
48
    uint8_t getElementSizeProxy() const noexcept override;
49
50
    //! The size of a single node in the HDF5 file.
51
    uint8_t m_elementSize = 0;
52
};
53
54
}  // namespace BAG
55
56
#endif  // BAG_SIMPLELAYERDESCRIPTOR_H
57