Updated Generic Nodes to have public properties
This commit is contained in:
parent
05d637acb5
commit
25091543a2
@ -8,17 +8,17 @@ namespace Generic {
|
|||||||
public:
|
public:
|
||||||
DirectedNode(T value, std::shared_ptr<NodeType> left = nullptr, std::shared_ptr<NodeType> right = nullptr);
|
DirectedNode(T value, std::shared_ptr<NodeType> left = nullptr, std::shared_ptr<NodeType> right = nullptr);
|
||||||
~DirectedNode();
|
~DirectedNode();
|
||||||
|
T value;
|
||||||
|
std::shared_ptr<NodeType> left;
|
||||||
|
std::shared_ptr<NodeType> right;
|
||||||
protected:
|
protected:
|
||||||
T mValue;
|
|
||||||
std::shared_ptr<NodeType> mLeft;
|
|
||||||
std::shared_ptr<NodeType> mRight;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename T, typename NodeType>
|
template <typename T, typename NodeType>
|
||||||
DirectedNode<T, NodeType>::DirectedNode(T value, std::shared_ptr<NodeType> left, std::shared_ptr<NodeType> right) {
|
DirectedNode<T, NodeType>::DirectedNode(T value, std::shared_ptr<NodeType> left, std::shared_ptr<NodeType> right) {
|
||||||
this->mValue = value;
|
this->value = value;
|
||||||
this->mLeft = left;
|
this->left = left;
|
||||||
this->mRight = right;
|
this->right = right;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T, typename NodeType>
|
template <typename T, typename NodeType>
|
||||||
|
@ -8,15 +8,14 @@ namespace Generic {
|
|||||||
public:
|
public:
|
||||||
UndirectedNode(T value, std::shared_ptr<NodeType> next = nullptr);
|
UndirectedNode(T value, std::shared_ptr<NodeType> next = nullptr);
|
||||||
~UndirectedNode();
|
~UndirectedNode();
|
||||||
protected:
|
T value;
|
||||||
T mValue;
|
std::shared_ptr<NodeType> next;
|
||||||
std::shared_ptr<NodeType> mNext;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename T, typename NodeType>
|
template <typename T, typename NodeType>
|
||||||
UndirectedNode<T, NodeType>::UndirectedNode(T value, std::shared_ptr<NodeType> next) {
|
UndirectedNode<T, NodeType>::UndirectedNode(T value, std::shared_ptr<NodeType> next) {
|
||||||
this->mValue = value;
|
this->value = value;
|
||||||
this->mNext = next;
|
this->next = next;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T, typename NodeType>
|
template <typename T, typename NodeType>
|
||||||
|
Loading…
Reference in New Issue
Block a user