You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
poc-links/include/links/NotImplementedLink.h

28 lines
1016 B
C++

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#pragma once
#include <vector>
#include "ifaces/ILink.h"
#include "Logger.h"
/// \brief Заглушка для не реализованной связи между элементами.
/// Все методы возвращают пустые значения или не выполняют действий.
/// \tparam TElem Тип элемента.
template <class TElem>
class NotImplementedLink : public ILink<TElem> {
using ElemPtr = std::shared_ptr<TElem>>;
public:
NotImplementedLink(ElemPtr node) {}
ElemPtr getNode() const override { return nullptr; }
ElemPtr getParent() const override { return nullptr; }
void setParent(const ElemPtr& parent) override { }
const std::vector<ElemPtr>& getChildren() const override { return empty_; }
void addChild(const ElemPtr& child) override { }
void removeChild(const ElemPtr& child) override { }
~NotImplementedLink() override {
Logger::get("ConDes").dbg("--- Destructor called for: NotImplementedLink");
}
private:
std::vector<ElemPtr> empty_;
};