Coverage Report

Created: 2025-07-11 06:33

/src/bag/api/bag_simplelayerdescriptor.h
Line
Count
Source (jump to first uncovered line)
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, uint64_t chunkSize, int compressionLevel);
20
21
    static std::shared_ptr<SimpleLayerDescriptor> open(const Dataset& dataset,
22
        LayerType type);
23
24
    SimpleLayerDescriptor(const SimpleLayerDescriptor&) = delete;
25
    SimpleLayerDescriptor(SimpleLayerDescriptor&&) = delete;
26
27
    SimpleLayerDescriptor& operator=(const SimpleLayerDescriptor&) = delete;
28
    SimpleLayerDescriptor& operator=(SimpleLayerDescriptor&&) = delete;
29
30
0
    bool operator==(const SimpleLayerDescriptor &rhs) const noexcept {
31
0
        return m_elementSize == rhs.m_elementSize;
32
0
    }
33
34
0
    bool operator!=(const SimpleLayerDescriptor &rhs) const noexcept {
35
0
        return !(rhs == *this);
36
0
    }
37
38
protected:
39
    SimpleLayerDescriptor(uint32_t id, LayerType type, uint64_t chunkSize,
40
        int compressionLevel);
41
    SimpleLayerDescriptor(const Dataset& dataset, LayerType type);
42
43
private:
44
    DataType getDataTypeProxy() const noexcept override;
45
    uint8_t getElementSizeProxy() const noexcept override;
46
47
    //! The size of a single node in the HDF5 file.
48
    uint8_t m_elementSize = 0;
49
};
50
51
}  // namespace BAG
52
53
#endif  // BAG_SIMPLELAYERDESCRIPTOR_H
54