Updated protection modifiers on generic nodes.
This commit is contained in:
parent
96d5eb8071
commit
e76f3b452e
@ -8,18 +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;
|
protected:
|
||||||
std::shared_ptr<NodeType> left;
|
T mValue;
|
||||||
std::shared_ptr<NodeType> right;
|
std::shared_ptr<NodeType> mLeft;
|
||||||
private:
|
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->value = value;
|
this->mValue = value;
|
||||||
this->left = left;
|
this->mLeft = left;
|
||||||
this->right = right;
|
this->mRight = right;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T, typename NodeType>
|
template <typename T, typename NodeType>
|
||||||
|
@ -6,18 +6,17 @@ namespace Generic {
|
|||||||
class UndirectedNode
|
class UndirectedNode
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
UndirectedNode(T value, std::shared_ptr<NodeType> left = nullptr, std::shared_ptr<NodeType> right = nullptr);
|
UndirectedNode(T value, std::shared_ptr<NodeType> next = nullptr);
|
||||||
~UndirectedNode();
|
~UndirectedNode();
|
||||||
T value;
|
protected:
|
||||||
std::shared_ptr<NodeType> next;
|
T mValue;
|
||||||
private:
|
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> left, std::shared_ptr<NodeType> right) {
|
UndirectedNode<T, NodeType>::UndirectedNode(T value, std::shared_ptr<NodeType> next) {
|
||||||
this->value = value;
|
this->mValue = value;
|
||||||
this->next = next;
|
this->mNext = next;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T, typename NodeType>
|
template <typename T, typename NodeType>
|
||||||
|
Loading…
Reference in New Issue
Block a user