diff --git a/repertory/librepertory/include/drives/fuse/fuse_base.hpp b/repertory/librepertory/include/drives/fuse/fuse_base.hpp index 71a332b5..284e0b67 100644 --- a/repertory/librepertory/include/drives/fuse/fuse_base.hpp +++ b/repertory/librepertory/include/drives/fuse/fuse_base.hpp @@ -31,7 +31,7 @@ class app_config; class i_provider; class fuse_base { - E_CONSUMER2(); + E_CONSUMER(); public: explicit fuse_base(app_config &config); diff --git a/repertory/librepertory/include/drives/winfsp/remotewinfsp/remote_winfsp_drive.hpp b/repertory/librepertory/include/drives/winfsp/remotewinfsp/remote_winfsp_drive.hpp index db398089..4da2c416 100644 --- a/repertory/librepertory/include/drives/winfsp/remotewinfsp/remote_winfsp_drive.hpp +++ b/repertory/librepertory/include/drives/winfsp/remotewinfsp/remote_winfsp_drive.hpp @@ -32,13 +32,13 @@ class lock_data; class server; namespace remote_winfsp { class remote_winfsp_drive final : public virtual FileSystemBase { - E_CONSUMER2(); + E_CONSUMER(); public: remote_winfsp_drive(app_config &config, remote_instance_factory factory, lock_data &lock); - ~remote_winfsp_drive() override { E_CONSUMER2_RELEASE(); } + ~remote_winfsp_drive() override { E_CONSUMER_RELEASE(); } public: class winfsp_service : virtual public Service { diff --git a/repertory/librepertory/include/drives/winfsp/winfsp_drive.hpp b/repertory/librepertory/include/drives/winfsp/winfsp_drive.hpp index e3f3b381..4609f40d 100644 --- a/repertory/librepertory/include/drives/winfsp/winfsp_drive.hpp +++ b/repertory/librepertory/include/drives/winfsp/winfsp_drive.hpp @@ -37,12 +37,12 @@ class i_provider; class winfsp_drive final : public virtual i_winfsp_drive, public virtual FileSystemBase { - E_CONSUMER2(); + E_CONSUMER(); public: winfsp_drive(app_config &config, lock_data &lockData, i_provider &provider); - ~winfsp_drive() override { E_CONSUMER2_RELEASE(); } + ~winfsp_drive() override { E_CONSUMER_RELEASE(); } private: class winfsp_service final : virtual public Service { diff --git a/repertory/librepertory/include/events/consumers/console_consumer.hpp b/repertory/librepertory/include/events/consumers/console_consumer.hpp index 28e1d45d..fa2cc311 100644 --- a/repertory/librepertory/include/events/consumers/console_consumer.hpp +++ b/repertory/librepertory/include/events/consumers/console_consumer.hpp @@ -27,7 +27,7 @@ namespace repertory { class console_consumer final { - E_CONSUMER2(); + E_CONSUMER(); public: console_consumer(); diff --git a/repertory/librepertory/include/events/consumers/logging_consumer.hpp b/repertory/librepertory/include/events/consumers/logging_consumer.hpp index 9d64549a..24303720 100644 --- a/repertory/librepertory/include/events/consumers/logging_consumer.hpp +++ b/repertory/librepertory/include/events/consumers/logging_consumer.hpp @@ -27,7 +27,7 @@ namespace repertory { class logging_consumer final { - E_CONSUMER2(); + E_CONSUMER(); public: logging_consumer(event_level level, std::string log_directory); diff --git a/repertory/librepertory/include/events/event_system.hpp b/repertory/librepertory/include/events/event_system.hpp index e17ed522..e5da4255 100644 --- a/repertory/librepertory/include/events/event_system.hpp +++ b/repertory/librepertory/include/events/event_system.hpp @@ -121,24 +121,24 @@ public: using event_consumer = event_system::event_consumer; -#define E_CONSUMER2() \ +#define E_CONSUMER() \ private: \ - std::vector> event_consumers2_ + std::vector> event_consumers_ -#define E_CONSUMER2_RELEASE() event_consumers2_.clear() +#define E_CONSUMER_RELEASE() event_consumers_.clear() -#define E_SUBSCRIBE2(name, callback) \ - event_consumers2_.emplace_back(std::make_shared( \ +#define E_SUBSCRIBE(name, callback) \ + event_consumers_.emplace_back(std::make_shared( \ #name, [this](const i_event &evt) { callback(evt); })) -#define E_SUBSCRIBE2_EXACT(name, callback) \ - event_consumers2_.emplace_back(std::make_shared( \ +#define E_SUBSCRIBE_EXACT(name, callback) \ + event_consumers_.emplace_back(std::make_shared( \ #name, [this](const i_event &evt) { \ callback(dynamic_cast(evt)); \ })) -#define E_SUBSCRIBE2_ALL(callback) \ - event_consumers2_.emplace_back(std::make_shared( \ +#define E_SUBSCRIBE_ALL(callback) \ + event_consumers_.emplace_back(std::make_shared( \ [this](const i_event &evt) { callback(evt); })) } // namespace repertory diff --git a/repertory/librepertory/include/file_manager/file_manager.hpp b/repertory/librepertory/include/file_manager/file_manager.hpp index ae54bb84..b27aee71 100644 --- a/repertory/librepertory/include/file_manager/file_manager.hpp +++ b/repertory/librepertory/include/file_manager/file_manager.hpp @@ -37,7 +37,7 @@ class app_config; class i_provider; class file_manager final : public i_file_manager, public i_upload_manager { - E_CONSUMER2(); + E_CONSUMER(); private: static constexpr const std::chrono::seconds queue_wait_secs{ diff --git a/repertory/librepertory/src/drives/fuse/fuse_base.cpp b/repertory/librepertory/src/drives/fuse/fuse_base.cpp index 4cf6cd2f..4d23999e 100644 --- a/repertory/librepertory/src/drives/fuse/fuse_base.cpp +++ b/repertory/librepertory/src/drives/fuse/fuse_base.cpp @@ -90,12 +90,12 @@ fuse_base::fuse_base(app_config &config) : config_(config) { fuse_ops_.flag_reserved = 0; #endif // FUSE_USE_VERSION < 30 - E_SUBSCRIBE2_EXACT(unmount_requested, [this](const unmount_requested &) { + E_SUBSCRIBE_EXACT(unmount_requested, [this](const unmount_requested &) { std::thread([this]() { this->shutdown(); }).detach(); }); } -fuse_base::~fuse_base() { E_CONSUMER2_RELEASE(); } +fuse_base::~fuse_base() { E_CONSUMER_RELEASE(); } auto fuse_base::access_(const char *path, int mask) -> int { REPERTORY_USES_FUNCTION_NAME(); diff --git a/repertory/librepertory/src/drives/winfsp/remotewinfsp/remote_winfsp_drive.cpp b/repertory/librepertory/src/drives/winfsp/remotewinfsp/remote_winfsp_drive.cpp index aa1cb1a9..27e82417 100644 --- a/repertory/librepertory/src/drives/winfsp/remotewinfsp/remote_winfsp_drive.cpp +++ b/repertory/librepertory/src/drives/winfsp/remotewinfsp/remote_winfsp_drive.cpp @@ -105,7 +105,7 @@ remote_winfsp_drive::remote_winfsp_drive(app_config &config, config_(config), lock_(lock), factory_(std::move(factory)) { - E_SUBSCRIBE2_EXACT(unmount_requested, [this](const unmount_requested &) { + E_SUBSCRIBE_EXACT(unmount_requested, [this](const unmount_requested &) { std::thread([this]() { this->shutdown(); }).detach(); }); } diff --git a/repertory/librepertory/src/drives/winfsp/winfsp_drive.cpp b/repertory/librepertory/src/drives/winfsp/winfsp_drive.cpp index 88519fdf..85082984 100644 --- a/repertory/librepertory/src/drives/winfsp/winfsp_drive.cpp +++ b/repertory/librepertory/src/drives/winfsp/winfsp_drive.cpp @@ -158,7 +158,7 @@ auto winfsp_drive::winfsp_service::OnStop() -> NTSTATUS { winfsp_drive::winfsp_drive(app_config &config, lock_data &lock, i_provider &provider) : provider_(provider), config_(config), lock_(lock) { - E_SUBSCRIBE2_EXACT(unmount_requested, [this](const unmount_requested &) { + E_SUBSCRIBE_EXACT(unmount_requested, [this](const unmount_requested &) { std::thread([this]() { this->shutdown(); }).detach(); }); } diff --git a/repertory/librepertory/src/events/consumers/console_consumer.cpp b/repertory/librepertory/src/events/consumers/console_consumer.cpp index c8233684..00075d9d 100644 --- a/repertory/librepertory/src/events/consumers/console_consumer.cpp +++ b/repertory/librepertory/src/events/consumers/console_consumer.cpp @@ -62,12 +62,12 @@ console_consumer::console_consumer(event_level level) { set_level(level); - E_SUBSCRIBE2_ALL(process_event2); - E_SUBSCRIBE2_EXACT(event_level_changed, + E_SUBSCRIBE_ALL(process_event2); + E_SUBSCRIBE_EXACT(event_level_changed, [](auto &&event) { set_level(event.level); }); } -console_consumer::~console_consumer() { E_CONSUMER2_RELEASE(); } +console_consumer::~console_consumer() { E_CONSUMER_RELEASE(); } void console_consumer::process_event2(const i_event &evt) { switch (evt.get_event_level()) { diff --git a/repertory/librepertory/src/events/consumers/logging_consumer.cpp b/repertory/librepertory/src/events/consumers/logging_consumer.cpp index d7447136..ca85aa7f 100644 --- a/repertory/librepertory/src/events/consumers/logging_consumer.cpp +++ b/repertory/librepertory/src/events/consumers/logging_consumer.cpp @@ -66,12 +66,12 @@ logging_consumer::logging_consumer(event_level level, set_level(level); - E_SUBSCRIBE2_ALL(process_event2); - E_SUBSCRIBE2_EXACT(event_level_changed, + E_SUBSCRIBE_ALL(process_event2); + E_SUBSCRIBE_EXACT(event_level_changed, [](auto &&event) { set_level(event.level); }); } -logging_consumer::~logging_consumer() { E_CONSUMER2_RELEASE(); } +logging_consumer::~logging_consumer() { E_CONSUMER_RELEASE(); } void logging_consumer::process_event2(const i_event &evt) { switch (evt.get_event_level()) { diff --git a/repertory/librepertory/src/file_manager/file_manager.cpp b/repertory/librepertory/src/file_manager/file_manager.cpp index cc33e23c..2363a769 100644 --- a/repertory/librepertory/src/file_manager/file_manager.cpp +++ b/repertory/librepertory/src/file_manager/file_manager.cpp @@ -58,7 +58,7 @@ file_manager::file_manager(app_config &config, i_provider &provider) return; } - E_SUBSCRIBE2_EXACT(file_upload_completed, + E_SUBSCRIBE_EXACT(file_upload_completed, [this](auto &&event) { this->upload_completed(event); }); } @@ -66,7 +66,7 @@ file_manager::~file_manager() { stop(); mgr_db_.reset(); - E_CONSUMER2_RELEASE(); + E_CONSUMER_RELEASE(); } void file_manager::close(std::uint64_t handle) { diff --git a/repertory/repertory_test/include/utils/event_capture.hpp b/repertory/repertory_test/include/utils/event_capture.hpp index e1472e22..7030039f 100644 --- a/repertory/repertory_test/include/utils/event_capture.hpp +++ b/repertory/repertory_test/include/utils/event_capture.hpp @@ -29,7 +29,7 @@ namespace repertory { class event_capture final { - E_CONSUMER2(); + E_CONSUMER(); public: explicit event_capture( @@ -37,13 +37,13 @@ public: std::vector non_fired_event_names = {}) : event_names_(std::move(event_names)), non_fired_event_names_(std::move(non_fired_event_names)) { - E_SUBSCRIBE2_ALL(process_event); + E_SUBSCRIBE_ALL(process_event); } ~event_capture() { wait_for_empty(); - E_CONSUMER2_RELEASE(); + E_CONSUMER_RELEASE(); EXPECT_TRUE(event_names_.empty()); for (const auto &event_name : event_names_) {