27 lines
679 B
C++

#pragma once
#include <memory>
namespace Generic {
template <typename T, typename NodeType>
class DirectedNode
{
public:
DirectedNode(T value, std::shared_ptr<NodeType> left = nullptr, std::shared_ptr<NodeType> right = nullptr);
~DirectedNode();
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->mValue = value;
this->mLeft = left;
this->mRight = right;
}
template <typename T, typename NodeType>
DirectedNode<T, NodeType>::~DirectedNode() {}
}