44 #if !defined(HAVE_CXX0X) || (defined(_MSC_VER) && _MSC_VER <= 1800)
46 : data_type_(std::move(other.data_type_)), parent_(std::move(other.parent_)), children(std::move(children))
51 data_type_ = std::move(other.data_type_);
52 parent_ = std::move(other.parent_);
53 children = std::move(other.children);
68 child->setParent(
this);
69 children.push_back(std::move(child));
74 if (children.size() > index)
76 children.erase(children.begin() + index);
91 return children[index].get();
106 return children.size();
117 std::vector<std::unique_ptr<BaseNode>> children;
134 #if !defined(HAVE_CXX0X) || (defined(_MSC_VER) && _MSC_VER <= 1800)
136 :
BaseNode(std::move(other)), attributes_(std::move(other.attributes_)), data_(std::move(other.data_))
142 attributes__ = std::move(other.attributes_);
143 data_ = std::move(other.data_);
153 void setData(std::unique_ptr<T> data);
155 void addAttribute(
const std::string& name,
const std::string& value);
159 std::map<std::string, std::string> attributes_;
160 std::unique_ptr<T> data_;
187 return std::move(data_);
193 data_ = std::move(data);
199 attributes_[name] = value;
virtual ~BaseNode()=default
BaseNode(const BaseNode &)=delete
bool removeChild(const size_t &index)
Definition: XMLTree.h:72
BaseNode(BaseNode &&other)
Definition: XMLTree.h:45
size_t getNumChildren() const
Definition: XMLTree.h:104
void setParent(BaseNode *parent)
Definition: XMLTree.h:99
void addChild(std::unique_ptr< BaseNode > child)
Definition: XMLTree.h:66
BaseNode * getChild(const size_t &index) const
Definition: XMLTree.h:85
BaseNode & operator=(const BaseNode &)=delete
BaseNode & operator=(BaseNode &&other)
Definition: XMLTree.h:49
BaseNode * getParent() const
Definition: XMLTree.h:94
std::vector< std::unique_ptr< BaseNode > > & getChildren()
Definition: XMLTree.h:109
BaseNode(NodeType type)
Definition: XMLTree.h:35
NodeType getType() const
Definition: XMLTree.h:61
Definition: XMLTree.h:122
DataNode(NodeType type)
Definition: XMLTree.h:164
const std::map< std::string, std::string > & getAttributes()
Definition: XMLTree.h:203
DataNode(const DataNode &)=delete
void addAttribute(const std::string &name, const std::string &value)
Definition: XMLTree.h:197
virtual ~DataNode()
Definition: XMLTree.h:174
std::unique_ptr< T > getData()
Definition: XMLTree.h:185
void setData(std::unique_ptr< T > data)
Definition: XMLTree.h:191
DataNode(DataNode &&other)
Definition: XMLTree.h:135
DataNode & operator=(DataNode &&other)
Definition: XMLTree.h:139
DataNode & operator=(const DataNode &)=delete
T * get() const
Definition: XMLTree.h:179
NodeType
Definition: XMLTree.h:13
eProsima namespace.
Definition: LibrarySettingsAttributes.h:23