IOLink 1.16.1
Loading...
Searching...
No Matches
MetadataNode.h
1#pragma once
2
3#include <memory>
4#include <mutex>
5#include <string>
6
7#include <iolink/VariantDataValue.h>
8#include <iolink/metadata/MetadataNodeIterator.h>
9#include <iolink/metadata/PrettyPrintOptions.h>
10
11namespace iolink
12{
13
21class IOLINK_API MetadataNode
22{
23public:
29 MetadataNode(const std::string& key, std::shared_ptr<VariantDataValue> value);
30
31 MetadataNode(const MetadataNode& other);
32 MetadataNode& operator=(const MetadataNode& other);
33
34 MetadataNode(MetadataNode&& other) noexcept;
35 MetadataNode& operator=(MetadataNode&& other) noexcept;
36
38
46 std::shared_ptr<MetadataNode> clone() const;
47
52 const std::string& key() const;
53
58 std::shared_ptr<VariantDataValue> value() const;
59
63 size_t childCount() const;
64
71 bool hasChild(const std::string& key) const;
72
80 std::shared_ptr<const MetadataNode> child(const std::string& key) const;
81
89 std::shared_ptr<MetadataNode> child(const std::string& key);
90
96 void addChild(std::shared_ptr<MetadataNode> child);
97
102 void removeChild(const std::string& key);
103
108
113
118
123
128
133
137 std::string toString() const;
138
152 std::string prettyPrint(const PrettyPrintOptions& options) const;
153
161 std::shared_ptr<MetadataNode> deepClone() const;
162
163private:
164 class Private;
165 friend class Private;
166 Private* m_private;
167};
168
169} // end namespace iolink