This commit is contained in:
Сергей Маринкевич
2025-07-23 13:17:26 +07:00
parent 0912566c5f
commit f994303cb5
5 changed files with 12 additions and 18 deletions
+3 -6
View File
@@ -5,18 +5,15 @@
class BaseNode : public INode,
public LazyLinkMixin<OneToManyLink>,
public std::enable_shared_from_this<BaseNode> {
public std::enable_shared_from_this<INode> {
public:
//using LazyLinkMixin<OneToManyLink>::linkChild;
//using LazyLinkMixin<OneToManyLink>::unlinkParent;
//using LazyLinkMixin<OneToManyLink>::getLink;
BaseNode(std::string name) : name_(std::move(name)) {}
const std::string& name() const override { return name_; }
~BaseNode() {
std::cout << "--- Destructor called for: " << name_ << "\n";
std::cout << "--- Base destructor called for: " << name_ << "\n";
}
protected:
NodePtr getShared() override {
NodePtr getNode() override {
return shared_from_this();
}
std::string name_;
+2 -3
View File
@@ -2,11 +2,10 @@
#include "nodes/BaseNode.h"
#include <iostream>
class SimpleNode :
public BaseNode {
class SimpleNode : public BaseNode {
public:
~SimpleNode() {
std::cout << "--- Destructor called for: " << name_ << "\n";
std::cout << "--- Simple destructor called for: " << name_ << "\n";
}
SimpleNode(std::string name) : BaseNode(std::move(name)) {}
};