/src/bag/api/bag_georefmetadatalayerdescriptor.h
Line | Count | Source |
1 | | #ifndef BAG_GEOREFMETDATALAYERDESCRIPTOR_H |
2 | | #define BAG_GEOREFMETDATALAYERDESCRIPTOR_H |
3 | | |
4 | | #include "bag_georefmetadatalayer.h" |
5 | | #include "bag_config.h" |
6 | | #include "bag_fordec.h" |
7 | | #include "bag_layerdescriptor.h" |
8 | | #include "bag_types.h" |
9 | | |
10 | | #include <memory> |
11 | | |
12 | | |
13 | | #ifdef _MSC_VER |
14 | | #pragma warning(push) |
15 | | #pragma warning(disable: 4251) // std classes do not have DL-interface when exporting |
16 | | #endif |
17 | | |
18 | | namespace BAG { |
19 | | |
20 | | //! Describe a georeferenced metadata layer. |
21 | | class BAG_API GeorefMetadataLayerDescriptor final : public LayerDescriptor |
22 | | { |
23 | | public: |
24 | | static std::shared_ptr<GeorefMetadataLayerDescriptor> |
25 | | create(Dataset& dataset, |
26 | | const std::string& name, GeorefMetadataProfile profile, DataType keyType, |
27 | | RecordDefinition definition, uint32_t rows, uint32_t cols, |
28 | | uint64_t chunkSize, int compressionLevel); |
29 | | static std::shared_ptr<GeorefMetadataLayerDescriptor> |
30 | | open(Dataset& dataset, const std::string& name); |
31 | | |
32 | | GeorefMetadataLayerDescriptor(const GeorefMetadataLayerDescriptor&) = delete; |
33 | | GeorefMetadataLayerDescriptor(GeorefMetadataLayerDescriptor&&) = delete; |
34 | | |
35 | | GeorefMetadataLayerDescriptor& operator=(const GeorefMetadataLayerDescriptor&) = delete; |
36 | | GeorefMetadataLayerDescriptor& operator=(GeorefMetadataLayerDescriptor&&) = delete; |
37 | | |
38 | 0 | bool operator==(const GeorefMetadataLayerDescriptor &rhs) const noexcept { |
39 | 0 | return m_profile == rhs.m_profile && |
40 | 0 | m_keyType == rhs.m_keyType && |
41 | 0 | m_elementSize == rhs.m_elementSize && |
42 | 0 | m_definition == rhs.m_definition && |
43 | 0 | weak_ptr_equals(m_pBagDataset, rhs.m_pBagDataset); |
44 | 0 | } |
45 | | |
46 | 0 | bool operator!=(const GeorefMetadataLayerDescriptor &rhs) const noexcept { |
47 | 0 | return !(rhs == *this); |
48 | 0 | } |
49 | | |
50 | | std::weak_ptr<Dataset> getDataset() const &; |
51 | | const RecordDefinition& getDefinition() const & noexcept; |
52 | | GeorefMetadataProfile getProfile(); |
53 | | |
54 | | protected: |
55 | | GeorefMetadataLayerDescriptor(Dataset& dataset, const std::string& name, GeorefMetadataProfile profile, |
56 | | DataType keyType, RecordDefinition definition, |
57 | | uint32_t rows, uint32_t cols, uint64_t chunkSize, |
58 | | int compressionLevel); |
59 | | |
60 | | private: |
61 | | DataType getDataTypeProxy() const noexcept override; |
62 | | uint8_t getElementSizeProxy() const noexcept override; |
63 | | |
64 | | //! The dataset this layer is from. |
65 | | std::weak_ptr<Dataset> m_pBagDataset; |
66 | | //! The metadata profile that this layer conforms to. |
67 | | GeorefMetadataProfile m_profile = UNKNOWN_METADATA_PROFILE; |
68 | | //! The key type. |
69 | | DataType m_keyType = DT_UNKNOWN_DATA_TYPE; |
70 | | //! The size of a single key in the single/variable resolution HDF5 file. |
71 | | uint8_t m_elementSize = 0; |
72 | | //! The list of fields making up the record/value. |
73 | | RecordDefinition m_definition; |
74 | | |
75 | | friend GeorefMetadataLayer; |
76 | | }; |
77 | | |
78 | | } // namespace BAG |
79 | | |
80 | | #ifdef _MSC_VER |
81 | | #pragma warning(pop) |
82 | | #endif |
83 | | |
84 | | #endif // BAG_GEOREFMETDATALAYERDESCRIPTOR_H |
85 | | |