#pragma once #include "Node.hpp" class Link : public Node { public: Link(); Link(const Link& node); ~Link() override; NodeType getType() const override { return LINK; } [[nodiscard]] std::shared_ptr clone() const override; [[nodiscard]] std::shared_ptr getLink() const; [[nodiscard]] bool isHardLink() const; std::shared_ptr getTarget() override; // link on link is not allowed, so no inf looping here std::shared_ptr findNode(const std::vector& path, ui32 currentDepth) override; void dumpUtil(std::ostream& ss, const Key& key, ui32 currentDepth, std::vector& indents) override; static bool linkNodes(const std::shared_ptr& link, const std::shared_ptr& target, bool hard); void removeOutgoingLinks() override; private: std::weak_ptr mLink; bool mIsHard = false; };