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;
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;
virtual ~BaseNode()=default
BaseNode(const BaseNode &)=delete
bool removeChild(const size_t &index)
Definition XMLTree.h:69
BaseNode(BaseNode &&)=default
BaseNode * getParent() const
Definition XMLTree.h:93
size_t getNumChildren() const
Definition XMLTree.h:104
void setParent(BaseNode *parent)
Definition XMLTree.h:98
void addChild(std::unique_ptr< BaseNode > child)
Definition XMLTree.h:62
BaseNode * getChild(const size_t &index) const
Definition XMLTree.h:83
BaseNode & operator=(const BaseNode &)=delete
std::vector< std::unique_ptr< BaseNode > > & getChildren()
Definition XMLTree.h:109
BaseNode(NodeType type)
Definition XMLTree.h:38
NodeType getType() const
Definition XMLTree.h:57
DataNode(NodeType type)
Definition XMLTree.h:160
const std::map< std::string, std::string > & getAttributes()
Definition XMLTree.h:211
DataNode(const DataNode &)=delete
void addAttribute(const std::string &name, const std::string &value)
Definition XMLTree.h:203
virtual ~DataNode()
Definition XMLTree.h:179
std::unique_ptr< T > getData()
Definition XMLTree.h:190
void setData(std::unique_ptr< T > data)
Definition XMLTree.h:196
DataNode & operator=(const DataNode &)=delete
T * get() const
Definition XMLTree.h:184
DataNode(DataNode &&)=default
const char * TOPIC
Publisher-subscriber attributes.
const char * LIBRARY_SETTINGS
NodeType
Definition XMLTree.h:14
eProsima namespace.
Definition LibrarySettingsAttributes.h:23