@@ -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
@@ -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) {
@@ -1,6 +1,6 @@
CR_EXPORT int cr_main(cr_plugin *ctx, cr_op operation) {
switch(operation) {
@@ -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
#include <entt/core/attribute.h>
ENTT_API void trigger(entt::dispatcher &dispatcher) {
dispatcher.trigger<event>();
@@ -3,7 +3,7 @@
#include <entt/core/utility.hpp>
ENTT_API void trigger(entt::dispatcher &);
-#ifndef ENTT_LIB_DISPATCHER_TYPES_H
-#define ENTT_LIB_DISPATCHER_TYPES_H
@@ -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>
@@ -2,7 +2,7 @@
#include <gtest/gtest.h>
TEST(Lib, Emitter) {
test_emitter emitter;
ENTT_API void emit(test_emitter &emitter) {
emitter.publish(event{});
ENTT_API void emit(test_emitter &);
@@ -1,15 +0,0 @@
-#ifndef ENTT_LIB_EMITTER_TYPES_H
-#define ENTT_LIB_EMITTER_TYPES_H
-#include <entt/signal/emitter.hpp>
-struct test_emitter
- : entt::emitter<test_emitter> {};
@@ -0,0 +1,8 @@
+#ifndef ENTT_LIB_LOCATOR_COMMON_TYPES_H
+#define ENTT_LIB_LOCATOR_COMMON_TYPES_H
+struct service {
+ int value;
@@ -3,6 +3,7 @@
#include <entt/locator/locator.hpp>
#include "types.h"
TEST(Lib, Locator) {
@@ -1,5 +1,6 @@
@@ -3,10 +3,6 @@
-struct service {
- int value;
struct userdata {
typename entt::locator<service>::node_type handle;
int value;
ENTT_API void set_up(const entt::locator<service>::node_type &handle) {
entt::locator<service>::reset(handle);
@@ -1,7 +1,7 @@
ENTT_API void set_up(const entt::locator<service>::node_type &);
ENTT_API void use_service(int);
@@ -1,8 +0,0 @@
-#ifndef ENTT_LIB_LOCATOR_TYPES_H
-#define ENTT_LIB_LOCATOR_TYPES_H
-#ifndef ENTT_LIB_REGISTRY_TYPES_H
-#define ENTT_LIB_REGISTRY_TYPES_H
+#ifndef ENTT_LIB_META_COMMON_TYPES_H
+#define ENTT_LIB_META_COMMON_TYPES_H
struct position {
int x;
@@ -4,6 +4,7 @@
#include <entt/meta/context.hpp>
#include <entt/meta/factory.hpp>
#include <entt/meta/meta.hpp>
position create_position(int x, int y) {
@@ -4,16 +4,6 @@
-struct position {
- int x;
- int y;
-struct velocity {
- double dx;
- double dy;
entt::locator<entt::meta_ctx>::node_type ctx;
entt::meta_any any;
-#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;
+struct velocity;
return position{x, y};
#include <entt/meta/resolve.hpp>
ENTT_API void share(entt::locator<entt::meta_ctx>::node_type);
ENTT_API void set_up();
@@ -1,14 +0,0 @@
-#ifndef ENTT_LIB_META_TYPES_H
-#define ENTT_LIB_META_TYPES_H
-#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
#include <entt/entity/registry.hpp>
TEST(Lib, Registry) {
entt::registry registry;
ENTT_API void update_position(entt::registry ®istry) {
registry.view<position, velocity>().each([](auto &pos, auto &vel) {
#include <entt/entity/entity.hpp>
ENTT_API void update_position(entt::registry &);
ENTT_API void emplace_velocity(entt::registry &);