Biorbd Release_1.13.0
Loading...
Searching...
No Matches
Node.cpp
1#define BIORBD_API_EXPORTS
2#include "Utils/Node.h"
3
4#include "Utils/String.h"
5
6using namespace BIORBD_NAMESPACE;
7
9 : m_name(std::make_shared<utils::String>("")),
10 m_parentName(std::make_shared<utils::String>("")),
12 std::make_shared<utils::NODE_TYPE>(utils::NODE_TYPE::NO_NODE_TYPE)) {}
13
15 // Shallow copy
16 m_name = other.m_name;
19}
20
22 : m_name(std::make_shared<utils::String>(name)),
23 m_parentName(std::make_shared<utils::String>("")),
25 std::make_shared<utils::NODE_TYPE>(utils::NODE_TYPE::NO_NODE_TYPE)) {}
26
28 : m_name(std::make_shared<utils::String>(name)),
29 m_parentName(std::make_shared<utils::String>(parentName)),
31 std::make_shared<utils::NODE_TYPE>(utils::NODE_TYPE::NO_NODE_TYPE)) {}
32
34
36 *m_name = *other.m_name;
37 *m_parentName = *other.m_parentName;
38 *m_typeOfNode = *other.m_typeOfNode;
39}
40
42
43const utils::String &utils::Node::name() const { return *m_name; }
44
46
48
49utils::NODE_TYPE utils::Node::typeOfNode() const { return *m_typeOfNode; }
A node is an abstract element which is assigned to a parent.
Definition Node.h:17
Node()
Construct Node.
Definition Node.cpp:8
void setParent(const String &name)
Set the parent name of the node.
Definition Node.cpp:47
const String & name() const
Return the name of the node.
Definition Node.cpp:43
NODE_TYPE typeOfNode() const
Return the type of node.
Definition Node.cpp:49
void setName(const String &name)
Set the name of the node.
Definition Node.cpp:41
std::shared_ptr< NODE_TYPE > m_typeOfNode
The type of the node.
Definition Node.h:92
void DeepCopy(const Node &other)
Deep copy of the node in another node.
Definition Node.cpp:35
std::shared_ptr< String > m_parentName
The parent name of the node.
Definition Node.h:91
const String & parent() const
Return the parent name of the node.
Definition Node.cpp:45
std::shared_ptr< String > m_name
The name of the node.
Definition Node.h:90
virtual ~Node()
Destroy class properly.
Definition Node.cpp:33
Wrapper around the std::string class with augmented functionality.
Definition String.h:18