diff --git a/CMakeLists.txt b/CMakeLists.txt index 745f2a1..11cb74a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 3.2 FATAL_ERROR) # BUILD_SHARED_LIBS can controll build type! PROJECT(EventBus - VERSION 2.0.0 + VERSION 2.0.1 LANGUAGES CXX ) diff --git a/include/eventbus/EventBus.h b/include/eventbus/EventBus.h index f0d60be..b43a671 100644 --- a/include/eventbus/EventBus.h +++ b/include/eventbus/EventBus.h @@ -167,6 +167,28 @@ public: notify(Dexode::Event{eventName}, std::forward(params)...); } + /** + * Notify all listeners for eventName. + * This is wrapper method only + * + * @param eventName name of event + */ + void notify(const std::string& eventName) + { + notify(Dexode::Event<>{eventName}); + } + + /** + * Notify all listeners for eventName. + * This is wrapper method only + * + * @param eventName name of event + */ + void notify(const char* const eventName) + { + notify(Dexode::Event<>{eventName}); + } + private: struct VectorInterface { diff --git a/test/eventbus/NotifierTest.cpp b/test/eventbus/NotifierTest.cpp index cdeb7dc..6afea63 100644 --- a/test/eventbus/NotifierTest.cpp +++ b/test/eventbus/NotifierTest.cpp @@ -171,7 +171,7 @@ TEST_CASE("eventbus/Different notification", "Valid check notification") REQUIRE(called1 == false); bus.notify(notification, 1); - + REQUIRE(called1 == true); REQUIRE(called2 == false); called1 = false;