mirror of
https://github.com/xfarrow/lasd.git
synced 2025-06-05 21:49:14 +02:00
Library 3
This commit is contained in:
@ -13,43 +13,48 @@ namespace lasd {
|
||||
/* ************************************************************************** */
|
||||
|
||||
template <typename Data>
|
||||
class BinaryTreeLnk { // Must extend BinaryTree<Data>
|
||||
class BinaryTreeLnk : virtual protected BinaryTree<Data>{ // Must extend BinaryTree<Data>
|
||||
|
||||
private:
|
||||
|
||||
// ...
|
||||
|
||||
protected:
|
||||
|
||||
// using BinaryTree<Data>::???;
|
||||
using BinaryTree<Data>::size;
|
||||
|
||||
// ...
|
||||
|
||||
struct NodeLnk { // Must extend Node
|
||||
struct NodeLnk : virtual protected BinaryTree<Data>::Node { // Must extend Node
|
||||
|
||||
private:
|
||||
|
||||
// ...
|
||||
|
||||
protected:
|
||||
|
||||
// ...
|
||||
using BinaryTree<Data>::Node::data;
|
||||
struct NodeLnk* left;
|
||||
struct* NodeLnk* right;
|
||||
|
||||
public:
|
||||
|
||||
// ...
|
||||
NodeLnk& operator=(const Node&); // Copy assignment of abstract types should not be possible.
|
||||
|
||||
// Move assignment
|
||||
NodeLnk& operator=(Node&&) noexcept override; // Move assignment of abstract types should not be possible.
|
||||
bool IsLeaf() const noexcept override; // (concrete function should not throw exceptions)
|
||||
bool HasLeftChild() const noexcept override; // (concrete function should not throw exceptions)
|
||||
bool HasRightChild() const noexcept override; // (concrete function should not throw exceptions)
|
||||
|
||||
Node& LeftChild() const override; // (concrete function must throw std::out_of_range when not existent)
|
||||
Node& RightChild() const override; // (concrete function must throw std::out_of_range when not existent)
|
||||
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
// Default constructor
|
||||
// BinaryTreeLnk() specifiers;
|
||||
BinaryTreeLnk();
|
||||
|
||||
/* ************************************************************************ */
|
||||
|
||||
// Specific constructors
|
||||
// BinaryTreeLnk(argument) specifiers; // A binary tree obtained from a LinearContainer
|
||||
BinaryTreeLnk(argument) specifiers; // A binary tree obtained from a LinearContainer
|
||||
|
||||
/* ************************************************************************ */
|
||||
|
||||
|
Reference in New Issue
Block a user