attaching schema nodes progress

This commit is contained in:
Sascha Kühl
2025-07-11 16:08:49 +02:00
parent 6982eebfd6
commit 27e2c51175
18 changed files with 697 additions and 446 deletions
@@ -0,0 +1,33 @@
#ifndef SHADOW_SCHEMA_HPP
#define SHADOW_SCHEMA_HPP
#include "matador/utils/result.hpp"
#include "matador/utils/error.hpp"
#include <memory>
#include <typeindex>
namespace matador::object {
class schema;
class schema_node;
}
namespace matador::object::internal {
class shadow_schema {
private:
using node_ptr = std::shared_ptr<schema_node>;
public:
explicit shadow_schema(object::schema& s);
schema& schema() const;
bool schema_contains(const std::type_index& ti) const;
[[nodiscard]] utils::result<node_ptr, utils::error> find_node(const std::type_index &type_index) const;
[[nodiscard]] utils::result<node_ptr, utils::error> attach_node(const std::shared_ptr<schema_node> &node) const;
[[nodiscard]] utils::result<void, utils::error> detach_node(const std::shared_ptr<schema_node> &node) const;
private:
object::schema& schema_;
};
}
#endif //SHADOW_SCHEMA_HPP