update subtree entt Merge commit '90ce4bda4e1dc23508bbd6b6923156cd5a370c18'

This commit is contained in:
2023-10-02 15:30:10 +02:00
153 changed files with 24263 additions and 14220 deletions

View File

@@ -0,0 +1,10 @@
#ifndef ENTT_LIB_DISPATCHER_COMMON_TYPES_H
#define ENTT_LIB_DISPATCHER_COMMON_TYPES_H
struct message {
int payload;
};
struct event {};
#endif

View File

@@ -4,7 +4,7 @@
#include <cr.h>
#include <entt/signal/dispatcher.hpp>
#include <entt/signal/sigh.hpp>
#include "types.h"
#include "../common/types.h"
struct listener {
void on(message msg) {

View File

@@ -1,6 +1,6 @@
#include <cr.h>
#include <entt/signal/dispatcher.hpp>
#include "types.h"
#include "../common/types.h"
CR_EXPORT int cr_main(cr_plugin *ctx, cr_op operation) {
switch(operation) {

View File

@@ -1,6 +1,6 @@
#include <entt/core/attribute.h>
#include <entt/signal/dispatcher.hpp>
#include "types.h"
#include "../common/types.h"
ENTT_API void trigger(entt::dispatcher &dispatcher) {
dispatcher.trigger<event>();

View File

@@ -3,7 +3,7 @@
#include <entt/core/utility.hpp>
#include <entt/signal/dispatcher.hpp>
#include <entt/signal/sigh.hpp>
#include "types.h"
#include "../common/types.h"
ENTT_API void trigger(entt::dispatcher &);

View File

@@ -1,12 +0,0 @@
#ifndef ENTT_LIB_DISPATCHER_TYPES_H
#define ENTT_LIB_DISPATCHER_TYPES_H
#include <entt/core/attribute.h>
struct ENTT_API message {
int payload;
};
struct ENTT_API event {};
#endif

View File

@@ -1,10 +0,0 @@
#ifndef ENTT_LIB_DISPATCHER_PLUGIN_TYPES_H
#define ENTT_LIB_DISPATCHER_PLUGIN_TYPES_H
struct message {
int payload;
};
struct event {};
#endif

View File

@@ -1,5 +1,5 @@
#ifndef ENTT_LIB_EMITTER_PLUGIN_TYPES_H
#define ENTT_LIB_EMITTER_PLUGIN_TYPES_H
#ifndef ENTT_LIB_EMITTER_COMMON_TYPES_H
#define ENTT_LIB_EMITTER_COMMON_TYPES_H
#include <entt/signal/emitter.hpp>

View File

@@ -2,7 +2,7 @@
#include <gtest/gtest.h>
#include <cr.h>
#include "types.h"
#include "../common/types.h"
TEST(Lib, Emitter) {
test_emitter emitter;

View File

@@ -1,5 +1,5 @@
#include <cr.h>
#include "types.h"
#include "../common/types.h"
CR_EXPORT int cr_main(cr_plugin *ctx, cr_op operation) {
switch(operation) {

View File

@@ -1,5 +1,5 @@
#include <entt/core/attribute.h>
#include "types.h"
#include "../common/types.h"
ENTT_API void emit(test_emitter &emitter) {
emitter.publish(event{});

View File

@@ -1,6 +1,6 @@
#include <gtest/gtest.h>
#include <entt/core/attribute.h>
#include "types.h"
#include "../common/types.h"
ENTT_API void emit(test_emitter &);

View File

@@ -1,16 +0,0 @@
#ifndef ENTT_LIB_EMITTER_TYPES_H
#define ENTT_LIB_EMITTER_TYPES_H
#include <entt/core/attribute.h>
#include <entt/signal/emitter.hpp>
struct ENTT_API test_emitter
: entt::emitter<test_emitter> {};
struct ENTT_API message {
int payload;
};
struct ENTT_API event {};
#endif

View File

@@ -0,0 +1,8 @@
#ifndef ENTT_LIB_LOCATOR_COMMON_TYPES_H
#define ENTT_LIB_LOCATOR_COMMON_TYPES_H
struct service {
int value;
};
#endif

View File

@@ -3,6 +3,7 @@
#include <gtest/gtest.h>
#include <cr.h>
#include <entt/locator/locator.hpp>
#include "../common/types.h"
#include "types.h"
TEST(Lib, Locator) {
@@ -10,9 +11,7 @@ TEST(Lib, Locator) {
ASSERT_EQ(entt::locator<service>::value().value, 42);
userdata ud{};
ud.handle = entt::locator<service>::handle();
ud.value = 3;
userdata ud{entt::locator<service>::handle(), 3};
cr_plugin ctx;
ctx.userdata = &ud;

View File

@@ -1,5 +1,6 @@
#include <cr.h>
#include <entt/locator/locator.hpp>
#include "../common/types.h"
#include "types.h"
CR_EXPORT int cr_main(cr_plugin *ctx, cr_op operation) {

View File

@@ -3,13 +3,10 @@
#include <entt/locator/locator.hpp>
struct service {
int value;
};
struct service;
struct userdata {
using node_type = typename entt::locator<service>::node_type;
node_type handle;
typename entt::locator<service>::node_type handle;
int value;
};

View File

@@ -1,6 +1,6 @@
#include <entt/core/attribute.h>
#include <entt/locator/locator.hpp>
#include "types.h"
#include "../common/types.h"
ENTT_API void set_up(const entt::locator<service>::node_type &handle) {
entt::locator<service>::reset(handle);

View File

@@ -1,7 +1,7 @@
#include <gtest/gtest.h>
#include <entt/core/attribute.h>
#include <entt/locator/locator.hpp>
#include "types.h"
#include "../common/types.h"
ENTT_API void set_up(const entt::locator<service>::node_type &);
ENTT_API void use_service(int);

View File

@@ -1,8 +0,0 @@
#ifndef ENTT_LIB_LOCATOR_TYPES_H
#define ENTT_LIB_LOCATOR_TYPES_H
struct service {
int value;
};
#endif

View File

@@ -1,5 +1,5 @@
#ifndef ENTT_LIB_META_TYPES_H
#define ENTT_LIB_META_TYPES_H
#ifndef ENTT_LIB_META_COMMON_TYPES_H
#define ENTT_LIB_META_COMMON_TYPES_H
struct position {
int x;

View File

@@ -14,8 +14,7 @@ TEST(Lib, Meta) {
ASSERT_FALSE(entt::resolve("position"_hs));
userdata ud{};
ud.ctx = entt::locator<entt::meta_ctx>::handle();
userdata ud{entt::locator<entt::meta_ctx>::handle(), entt::meta_any{}};
cr_plugin ctx;
ctx.userdata = &ud;

View File

@@ -4,6 +4,7 @@
#include <entt/meta/context.hpp>
#include <entt/meta/factory.hpp>
#include <entt/meta/meta.hpp>
#include "../common/types.h"
#include "types.h"
position create_position(int x, int y) {

View File

@@ -4,16 +4,6 @@
#include <entt/locator/locator.hpp>
#include <entt/meta/meta.hpp>
struct position {
int x;
int y;
};
struct velocity {
double dx;
double dy;
};
struct userdata {
entt::locator<entt::meta_ctx>::node_type ctx;
entt::meta_any any;

View File

@@ -3,6 +3,7 @@
#include <entt/meta/context.hpp>
#include <entt/meta/factory.hpp>
#include <entt/meta/meta.hpp>
#include "../common/types.h"
#include "types.h"
position create_position(int x, int y) {

View File

@@ -1,5 +1,5 @@
#ifndef ENTT_LIB_META_PLUGIN_TYPES_STD_H
#define ENTT_LIB_META_PLUGIN_TYPES_STD_H
#ifndef ENTT_LIB_META_PLUGIN_STD_TYPES_H
#define ENTT_LIB_META_PLUGIN_STD_TYPES_H
#include <type_traits>
#include <entt/core/hashed_string.hpp>
@@ -17,15 +17,8 @@ struct custom_type_hash;
} \
}
struct position {
int x;
int y;
};
struct velocity {
double dx;
double dy;
};
struct position;
struct velocity;
struct userdata {
entt::locator<entt::meta_ctx>::node_type ctx;

View File

@@ -2,7 +2,7 @@
#include <entt/core/hashed_string.hpp>
#include <entt/meta/factory.hpp>
#include <entt/meta/meta.hpp>
#include "types.h"
#include "../common/types.h"
position create_position(int x, int y) {
return position{x, y};

View File

@@ -4,7 +4,7 @@
#include <entt/meta/factory.hpp>
#include <entt/meta/meta.hpp>
#include <entt/meta/resolve.hpp>
#include "types.h"
#include "../common/types.h"
ENTT_API void share(entt::locator<entt::meta_ctx>::node_type);
ENTT_API void set_up();

View File

@@ -1,5 +1,5 @@
#ifndef ENTT_LIB_REGISTRY_PLUGIN_TYPES_H
#define ENTT_LIB_REGISTRY_PLUGIN_TYPES_H
#ifndef ENTT_LIB_REGISTRY_COMMON_TYPES_H
#define ENTT_LIB_REGISTRY_COMMON_TYPES_H
struct position {
int x;

View File

@@ -3,7 +3,7 @@
#include <gtest/gtest.h>
#include <cr.h>
#include <entt/entity/registry.hpp>
#include "types.h"
#include "../common/types.h"
TEST(Lib, Registry) {
entt::registry registry;

View File

@@ -1,6 +1,6 @@
#include <cr.h>
#include <entt/entity/registry.hpp>
#include "types.h"
#include "../common/types.h"
CR_EXPORT int cr_main(cr_plugin *ctx, cr_op operation) {
switch(operation) {

View File

@@ -1,6 +1,8 @@
#include <entt/core/attribute.h>
#include <entt/entity/registry.hpp>
#include "types.h"
#include "../common/types.h"
template class entt::basic_registry<entt::entity>;
ENTT_API void update_position(entt::registry &registry) {
registry.view<position, velocity>().each([](auto &pos, auto &vel) {

View File

@@ -2,7 +2,7 @@
#include <entt/core/attribute.h>
#include <entt/entity/entity.hpp>
#include <entt/entity/registry.hpp>
#include "types.h"
#include "../common/types.h"
ENTT_API void update_position(entt::registry &);
ENTT_API void emplace_velocity(entt::registry &);

View File

@@ -1,16 +0,0 @@
#ifndef ENTT_LIB_REGISTRY_TYPES_H
#define ENTT_LIB_REGISTRY_TYPES_H
#include <entt/core/attribute.h>
struct ENTT_API position {
int x;
int y;
};
struct ENTT_API velocity {
double dx;
double dy;
};
#endif