#pragma once #include "links/BaseLink.h" template class OneToManyLink : public BaseLink { public: OneToManyLink(std::shared_ptr e) : BaseLink(e) {} void addChild(const std::shared_ptr& child) override { /* Each child must be exactly the same type as parent */ if (typeid(*child) != typeid(*this->owner_node_.lock())) throw std::logic_error("Foundling child"); BaseLink::addChild(child); } };