/src/bag/api/bag_interleavedlegacylayer.h
Line | Count | Source (jump to first uncovered line) |
1 | | #ifndef BAG_INTERLEAVEDLAYER |
2 | | #define BAG_INTERLEAVEDLAYER |
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 H5 { |
14 | | |
15 | | class DataSet; |
16 | | |
17 | | } // namespace H5 |
18 | | |
19 | | namespace BAG { |
20 | | |
21 | | #ifdef _MSC_VER |
22 | | #pragma warning(push) |
23 | | #pragma warning(disable: 4251) // std classes do not have DLL-interface when exporting |
24 | | #endif |
25 | | |
26 | | //! The interface for an interleaved layer. |
27 | | /*! |
28 | | This class is only here to support older (pre 2.0) BAGs that have an optional |
29 | | layer of NODE or ELEVATION group type. |
30 | | In 2.0, these "interleaved" layers are split up into layers of each type in |
31 | | the group. |
32 | | The NODE group is made of Hypothesis_Strength and Num_Hypotheses. |
33 | | The ELEVATION group is made of Shoal_Elevation, Std_Dev and Num_Soundings. |
34 | | */ |
35 | | class BAG_API InterleavedLegacyLayer final : public Layer |
36 | | { |
37 | | public: |
38 | | InterleavedLegacyLayer(Dataset& dataset, |
39 | | InterleavedLegacyLayerDescriptor& descriptor, |
40 | | std::unique_ptr<::H5::DataSet, DeleteH5dataSet> h5dataSet); |
41 | | |
42 | | InterleavedLegacyLayer(const InterleavedLegacyLayer&) = delete; |
43 | | InterleavedLegacyLayer(InterleavedLegacyLayer&&) = delete; |
44 | | |
45 | | InterleavedLegacyLayer& operator=(const InterleavedLegacyLayer&) = delete; |
46 | | InterleavedLegacyLayer& operator=(InterleavedLegacyLayer&&) = delete; |
47 | | |
48 | 0 | bool operator==(const InterleavedLegacyLayer &rhs) const noexcept { |
49 | 0 | return m_pH5dataSet == rhs.m_pH5dataSet; |
50 | 0 | } |
51 | | |
52 | 0 | bool operator!=(const InterleavedLegacyLayer &rhs) const noexcept { |
53 | 0 | return !(rhs == *this); |
54 | 0 | } |
55 | | |
56 | | protected: |
57 | | static std::shared_ptr<InterleavedLegacyLayer> open(Dataset& dataset, |
58 | | InterleavedLegacyLayerDescriptor& descriptor); |
59 | | |
60 | | private: |
61 | | UInt8Array readProxy(uint32_t rowStart, |
62 | | uint32_t columnStart, uint32_t rowEnd, uint32_t columnEnd) const override; |
63 | | |
64 | | void writeProxy(uint32_t rowStart, uint32_t columnStart, uint32_t rowEnd, |
65 | | uint32_t columnEnd, const uint8_t *buffer) override; |
66 | | |
67 | | void writeAttributesProxy() const override; |
68 | | |
69 | | //! The HDF5 DataSet. |
70 | | std::unique_ptr<H5::DataSet, DeleteH5dataSet> m_pH5dataSet; |
71 | | |
72 | | friend Dataset; |
73 | | }; |
74 | | |
75 | | #ifdef _MSC_VER |
76 | | #pragma warning(pop) |
77 | | #endif |
78 | | |
79 | | } // namespace BAG |
80 | | |
81 | | #endif // BAG_INTERLEAVEDLAYER |
82 | | |