55 #if !defined(HAVE_CXX0X) || (defined(_MSC_VER) && _MSC_VER <= 1800)
58 : data_type_(std::move(other.data_type_))
59 , parent_(std::move(other.parent_))
60 , children(std::move(other.children))
67 data_type_ = std::move(other.data_type_);
68 parent_ = std::move(other.parent_);
69 children = std::move(other.children);
86 std::unique_ptr<BaseNode> child)
88 child->setParent(
this);
89 children.push_back(std::move(child));
95 if (children.size() > index)
97 children.erase(children.begin() + index);
107 const size_t& index)
const
109 if (children.empty())
113 return children[index].get();
129 return children.size();
141 std::vector<std::unique_ptr<BaseNode>> children;
153 std::unique_ptr<T> data);
164 #if !defined(HAVE_CXX0X) || (defined(_MSC_VER) && _MSC_VER <= 1800)
168 , attributes_(std::move(other.attributes_))
169 , data_(std::move(other.data_))
177 attributes_ = std::move(other.attributes_);
178 data_ = std::move(other.data_);
192 std::unique_ptr<T> data);
195 const std::string& name,
196 const std::string& value);
201 std::map<std::string, std::string> attributes_;
202 std::unique_ptr<T> data_;
217 std::unique_ptr<T> data)
220 , data_(std::move(data))
238 return std::move(data_);
243 std::unique_ptr<T> data)
245 data_ = std::move(data);
250 const std::string& name,
251 const std::string& value)
253 attributes_[name] = value;
virtual ~BaseNode()=default
BaseNode(const BaseNode &)=delete
bool removeChild(const size_t &index)
Definition: XMLTree.h:92
BaseNode(BaseNode &&other)
Definition: XMLTree.h:56
size_t getNumChildren() const
Definition: XMLTree.h:127
void setParent(BaseNode *parent)
Definition: XMLTree.h:121
void addChild(std::unique_ptr< BaseNode > child)
Definition: XMLTree.h:85
BaseNode * getChild(const size_t &index) const
Definition: XMLTree.h:106
BaseNode & operator=(const BaseNode &)=delete
BaseNode * getParent() const
Definition: XMLTree.h:116
std::vector< std::unique_ptr< BaseNode > > & getChildren()
Definition: XMLTree.h:132
BaseNode(NodeType type)
Definition: XMLTree.h:38
NodeType getType() const
Definition: XMLTree.h:80
Definition: XMLTree.h:146
DataNode(NodeType type)
Definition: XMLTree.h:206
const std::map< std::string, std::string > & getAttributes()
Definition: XMLTree.h:257
DataNode(const DataNode &)=delete
void addAttribute(const std::string &name, const std::string &value)
Definition: XMLTree.h:249
virtual ~DataNode()
Definition: XMLTree.h:225
std::unique_ptr< T > getData()
Definition: XMLTree.h:236
void setData(std::unique_ptr< T > data)
Definition: XMLTree.h:242
DataNode(DataNode &&other)
Definition: XMLTree.h:165
DataNode & operator=(const DataNode &)=delete
T * get() const
Definition: XMLTree.h:230
NodeType
Definition: XMLTree.h:14
eProsima namespace.
Definition: LibrarySettingsAttributes.h:23