qosd: сдавленные наброски по абстрактному дереву
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
#pragma once
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
#include "ifaces/ILinkMixin.h"
|
||||
|
||||
/// \brief Интерфейс для классов-связей между элементами.
|
||||
/// \tparam TElem Тип элемента, между которыми устанавливается связь.
|
||||
template <class TElem>
|
||||
class ILink {
|
||||
public:
|
||||
using ElemPtr = std::shared_ptr<TElem>;
|
||||
|
||||
virtual ~ILink() = default;
|
||||
virtual ElemPtr getNode() const = 0;
|
||||
virtual ElemPtr getParent() const = 0;
|
||||
virtual void setParent(const ElemPtr& parent) = 0;
|
||||
virtual const std::vector<ElemPtr>& getChildren() const = 0;
|
||||
virtual void addChild(const ElemPtr& child) = 0;
|
||||
virtual void removeChild(const ElemPtr& child) = 0;
|
||||
virtual void replaceChild(const ElemPtr& oldChild, const ElemPtr& newChild) = 0;
|
||||
};
|
||||
Reference in New Issue
Block a user