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