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