poperdolilo

This commit is contained in:
Сергей Маринкевич
2025-07-21 18:14:27 +07:00
parent 8b60fc0183
commit b2be9b51ca
10 changed files with 230 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
#pragma once
#include "mixins/LazyLinkMixin.h"
class SimpleNode : public LazyLinkMixin<SimpleNode>,
public std::enable_shared_from_this<SimpleNode> {
public:
static NodePtr create(std::string name) {
struct EnableMakeShared : public SimpleNode {
EnableMakeShared(std::string n) : SimpleNode(std::move(n)) {}
};
return std::make_shared<EnableMakeShared>(std::move(name));
}
const std::string& name() const override { return name_; }
protected:
std::shared_ptr<SimpleNode> getShared() override {
return shared_from_this();
}
private:
friend class LazyLinkMixin<SimpleNode>;
explicit SimpleNode(std::string name) : name_(std::move(name)) {}
std::string name_;
};