 |
FastRTPS
Version 2.11.2
FastRTPS
|
63 std::unique_ptr<BaseNode> child)
65 child->setParent(
this);
66 children.push_back(std::move(child));
72 if (children.size() > index)
74 children.erase(children.begin() + index);
84 const size_t& index)
const
90 return children[index].get();
106 return children.size();
118 std::vector<std::unique_ptr<BaseNode>> children;
122 class DataNode :
public BaseNode
130 std::unique_ptr<T> data);
146 std::unique_ptr<T> data);
149 const std::string& name,
150 const std::string& value);
155 std::map<std::string, std::string> attributes_;
156 std::unique_ptr<T> data_;
171 std::unique_ptr<T> data)
174 , data_(std::move(data))
192 return std::move(data_);
197 std::unique_ptr<T> data)
199 data_ = std::move(data);
204 const std::string& name,
205 const std::string& value)
207 attributes_[name] = value;
219 #endif // !_XML_TREE_
void addAttribute(const std::string &name, const std::string &value)
Definition: XMLTree.h:203
void addChild(std::unique_ptr< BaseNode > child)
Definition: XMLTree.h:62
void setParent(BaseNode *parent)
Definition: XMLTree.h:98
DataNode(NodeType type)
Definition: XMLTree.h:160
virtual ~DataNode()
Definition: XMLTree.h:179
DataNode & operator=(const DataNode &)=delete
BaseNode & operator=(const BaseNode &)=delete
virtual ~BaseNode()=default
BaseNode * getChild(const size_t &index) const
Definition: XMLTree.h:83
T * get() const
Definition: XMLTree.h:184
std::unique_ptr< T > getData()
Definition: XMLTree.h:190
const std::map< std::string, std::string > & getAttributes()
Definition: XMLTree.h:211
bool removeChild(const size_t &index)
Definition: XMLTree.h:69
size_t getNumChildren() const
Definition: XMLTree.h:104
std::vector< std::unique_ptr< BaseNode > > & getChildren()
Definition: XMLTree.h:109
BaseNode * getParent() const
Definition: XMLTree.h:93
BaseNode(NodeType type)
Definition: XMLTree.h:38
NodeType getType() const
Definition: XMLTree.h:57
void setData(std::unique_ptr< T > data)
Definition: XMLTree.h:196
Definition: LibrarySettingsAttributes.h:23
NodeType
Definition: XMLTree.h:13