64 std::unique_ptr<BaseNode> child)
66 child->setParent(
this);
67 children.push_back(std::move(child));
73 if (children.size() > index)
75 children.erase(children.begin() + index);
85 const size_t& index)
const
91 return children[index].get();
107 return children.size();
119 std::vector<std::unique_ptr<BaseNode>> children;
131 std::unique_ptr<T> data);
147 std::unique_ptr<T> data);
150 const std::string& name,
151 const std::string& value);
156 std::map<std::string, std::string> attributes_;
157 std::unique_ptr<T> data_;
172 std::unique_ptr<T> data)
175 , data_(std::move(data))
193 return std::move(data_);
198 std::unique_ptr<T> data)
200 data_ = std::move(data);
205 const std::string& name,
206 const std::string& value)
208 attributes_[name] = value;
virtual ~BaseNode()=default
BaseNode(const BaseNode &)=delete
bool removeChild(const size_t &index)
Definition XMLTree.h:70
BaseNode(BaseNode &&)=default
BaseNode * getParent() const
Definition XMLTree.h:94
size_t getNumChildren() const
Definition XMLTree.h:105
void setParent(BaseNode *parent)
Definition XMLTree.h:99
void addChild(std::unique_ptr< BaseNode > child)
Definition XMLTree.h:63
BaseNode * getChild(const size_t &index) const
Definition XMLTree.h:84
BaseNode & operator=(const BaseNode &)=delete
std::vector< std::unique_ptr< BaseNode > > & getChildren()
Definition XMLTree.h:110
BaseNode(NodeType type)
Definition XMLTree.h:39
NodeType getType() const
Definition XMLTree.h:58
DataNode(NodeType type)
Definition XMLTree.h:161
const std::map< std::string, std::string > & getAttributes()
Definition XMLTree.h:212
DataNode(const DataNode &)=delete
void addAttribute(const std::string &name, const std::string &value)
Definition XMLTree.h:204
virtual ~DataNode()
Definition XMLTree.h:180
std::unique_ptr< T > getData()
Definition XMLTree.h:191
void setData(std::unique_ptr< T > data)
Definition XMLTree.h:197
DataNode & operator=(const DataNode &)=delete
T * get() const
Definition XMLTree.h:185
DataNode(DataNode &&)=default
const char * TOPIC
Publisher-subscriber attributes.
const char * DOMAINPARTICIPANT_FACTORY
const char * LIBRARY_SETTINGS
NodeType
Definition XMLTree.h:14
eProsima namespace.
Definition LibrarySettingsAttributes.h:23