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<iostream>
#include"mixins/BaseLinkMixin.h"
#include<memory>
#include"Logger.h"
/// \brief Миксин для ленивой инициализации связи (link) с дочерними элементами.
/// \tparam TLink Тип используемой связи (link).
template<classTLink>
classLazyLinkMixin:publicBaseLinkMixin{
public:
voidunlinkParent()override{
/* No link -- no parent, who'll unlinked? */
if(!this->link_)
throwstd::logic_error("Link isn't inited!");
BaseLinkMixin::unlinkParent();
}
LinkPtrgetLink()override{
lazyInit();
returnthis->link_;
}
LazyLinkMixin(){}
~LazyLinkMixin()override{
Logger::get("ConDes").info("--- Destructor called for: LazyLinkMixin");