/src/bag/api/bag_georefmetadatalayerdescriptor.h
Line | Count | Source (jump to first uncovered line) |
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> create(Dataset& dataset, |
25 | | const std::string& name, GeorefMetadataProfile profile, DataType keyType, |
26 | | RecordDefinition definition, uint64_t chunkSize, |
27 | | int compressionLevel); |
28 | | static std::shared_ptr<GeorefMetadataLayerDescriptor> open(Dataset& dataset, |
29 | | const std::string& name); |
30 | | |
31 | | GeorefMetadataLayerDescriptor(const GeorefMetadataLayerDescriptor&) = delete; |
32 | | GeorefMetadataLayerDescriptor(GeorefMetadataLayerDescriptor&&) = delete; |
33 | | |
34 | | GeorefMetadataLayerDescriptor& operator=(const GeorefMetadataLayerDescriptor&) = delete; |
35 | | GeorefMetadataLayerDescriptor& operator=(GeorefMetadataLayerDescriptor&&) = delete; |
36 | | |
37 | 0 | bool operator==(const GeorefMetadataLayerDescriptor &rhs) const noexcept { |
38 | 0 | return m_profile == rhs.m_profile && |
39 | 0 | m_keyType == rhs.m_keyType && |
40 | 0 | m_elementSize == rhs.m_elementSize && |
41 | 0 | m_definition == rhs.m_definition && |
42 | 0 | weak_ptr_equals(m_pBagDataset, rhs.m_pBagDataset); |
43 | 0 | } |
44 | | |
45 | 0 | bool operator!=(const GeorefMetadataLayerDescriptor &rhs) const noexcept { |
46 | 0 | return !(rhs == *this); |
47 | 0 | } |
48 | | |
49 | | std::weak_ptr<Dataset> getDataset() const &; |
50 | | const RecordDefinition& getDefinition() const & noexcept; |
51 | | GeorefMetadataProfile getProfile(); |
52 | | |
53 | | protected: |
54 | | GeorefMetadataLayerDescriptor(Dataset& dataset, const std::string& name, GeorefMetadataProfile profile, |
55 | | DataType keyType, RecordDefinition definition, uint64_t chunkSize, |
56 | | int compressionLevel); |
57 | | |
58 | | private: |
59 | | DataType getDataTypeProxy() const noexcept override; |
60 | | uint8_t getElementSizeProxy() const noexcept override; |
61 | | |
62 | | //! The dataset this layer is from. |
63 | | std::weak_ptr<Dataset> m_pBagDataset; |
64 | | //! The metadata profile that this layer conforms to. |
65 | | GeorefMetadataProfile m_profile = UNKNOWN_METADATA_PROFILE; |
66 | | //! The key type. |
67 | | DataType m_keyType = DT_UNKNOWN_DATA_TYPE; |
68 | | //! The size of a single key in the single/variable resolution HDF5 file. |
69 | | uint8_t m_elementSize = 0; |
70 | | //! The list of fields making up the record/value. |
71 | | RecordDefinition m_definition; |
72 | | |
73 | | friend GeorefMetadataLayer; |
74 | | }; |
75 | | |
76 | | } // namespace BAG |
77 | | |
78 | | #ifdef _MSC_VER |
79 | | #pragma warning(pop) |
80 | | #endif |
81 | | |
82 | | #endif // BAG_GEOREFMETDATALAYERDESCRIPTOR_H |
83 | | |