attaching schema nodes progress
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user