registry/dispatcher/emitter: removed ::discard, updated test and doc

This commit is contained in:
Michele Caini
2019-12-29 15:16:12 +01:00
parent 37dd1ae363
commit 43766406ae
28 changed files with 261 additions and 177 deletions
+3 -6
View File
@@ -1,17 +1,14 @@
#include <cr.h>
#include <entt/signal/emitter.hpp>
#include "types.h"
CR_EXPORT int cr_main(cr_plugin *ctx, cr_op operation) {
switch (operation) {
case CR_STEP:
static_cast<test_emitter *>(ctx->userdata)->publish<event>();
static_cast<test_emitter *>(ctx->userdata)->publish<message>(42);
static_cast<test_emitter *>(ctx->userdata)->publish<message>(3);
static_cast<emitter_proxy *>(ctx->userdata)->publish(event{});
static_cast<emitter_proxy *>(ctx->userdata)->publish(message{42});
static_cast<emitter_proxy *>(ctx->userdata)->publish(message{3});
break;
case CR_CLOSE:
static_cast<test_emitter *>(ctx->userdata)->discard<event>();
break;
case CR_LOAD:
case CR_UNLOAD:
// nothing to do here, this is only a test.