/src/bag/api/bag_vrrefinements.h
Line | Count | Source (jump to first uncovered line) |
1 | | #ifndef BAG_VRREFINEMENTS_H |
2 | | #define BAG_VRREFINEMENTS_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 | | //! The interface for the variable resolution refinements layer. |
20 | | class BAG_API VRRefinements final : public Layer |
21 | | { |
22 | | public: |
23 | | VRRefinements(const VRRefinements&) = delete; |
24 | | VRRefinements(VRRefinements&&) = delete; |
25 | | |
26 | | VRRefinements& operator=(const VRRefinements&) = delete; |
27 | | VRRefinements& operator=(VRRefinements&&) = delete; |
28 | | |
29 | 0 | bool operator==(const VRRefinements &rhs) const noexcept { |
30 | 0 | return m_pH5dataSet == rhs.m_pH5dataSet; |
31 | 0 | } |
32 | | |
33 | 0 | bool operator!=(const VRRefinements &rhs) const noexcept { |
34 | 0 | return !(rhs == *this); |
35 | 0 | } |
36 | | |
37 | | std::shared_ptr<VRRefinementsDescriptor> getDescriptor() & noexcept; |
38 | | std::shared_ptr<const VRRefinementsDescriptor> getDescriptor() const & noexcept; |
39 | | |
40 | | protected: |
41 | | VRRefinements(Dataset& dataset, |
42 | | VRRefinementsDescriptor& descriptor, |
43 | | std::unique_ptr<::H5::DataSet, DeleteH5dataSet> h5dataSet); |
44 | | |
45 | | static std::unique_ptr<VRRefinements> create(Dataset& dataset, |
46 | | uint64_t chunkSize, int compressionLevel); |
47 | | |
48 | | static std::unique_ptr<VRRefinements> open(Dataset& dataset, |
49 | | VRRefinementsDescriptor& descriptor); |
50 | | |
51 | | private: |
52 | | static std::unique_ptr<::H5::DataSet, DeleteH5dataSet> |
53 | | createH5dataSet(const Dataset& dataset, |
54 | | const VRRefinementsDescriptor& 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_VRREFINEMENTS_H |
77 | | |