added more tests

This commit is contained in:
Sascha Kühl
2025-02-06 16:17:47 +01:00
parent c76aa56440
commit 0b70f5d4ee
68 changed files with 2117 additions and 263 deletions
+6 -21
View File
@@ -1,6 +1,8 @@
#ifndef BASIC_PROTOTYPE_INFO_HPP
#define BASIC_PROTOTYPE_INFO_HPP
#include "matador/object/object_definition.hpp"
#include <string>
#include <typeindex>
@@ -14,35 +16,18 @@ public:
[[nodiscard]] std::type_index type_index() const;
[[nodiscard]] std::string name() const;
[[nodiscard]] const object_definition& definition() const;
protected:
basic_object_info(schema_node &node, std::type_index type_index);
basic_object_info(schema_node &node, std::type_index type_index, object_definition &&definition);
protected:
schema_node &node_; /**< prototype node of the represented object type */
std::type_index type_index_; /**< type index of the represented object type */
object_definition definition_;
};
template<typename Type>
class object_info final : public basic_object_info {
public:
explicit object_info(schema_node &node)
: basic_object_info(node, typeid(Type)) {}
const Type &prototype() const { return prototype_; }
private:
Type prototype_;
};
template<typename Type>
using object_info_ref = std::reference_wrapper<const object_info<Type>>;
namespace detail {
struct null_type {};
}
using null_info = object_info<detail::null_type>;
using basic_object_info_ref = std::reference_wrapper<const basic_object_info>;
}