diff --git a/src/internal/mana_analysis.h b/src/internal/mana_analysis.h index abc9694..dcd8f25 100644 --- a/src/internal/mana_analysis.h +++ b/src/internal/mana_analysis.h @@ -47,7 +47,7 @@ struct ModuleDataStage std::vector> moduleInfo; RunInfo runInfo; nlohmann::json runDescriptor; - ManaPlugin *sink = nullptr; + IManaSink *sink = nullptr; void *sinkContext = nullptr; }; @@ -196,7 +196,7 @@ inline nlohmann::json make_run_descriptor(const RunInfo &runInfo) inline ModuleDataStage make_module_data_stage(const std::string &runName, mana::Arena &&arena, const mvlc::CrateConfig &crateConfig, - nlohmann::json moduleDb, ManaPlugin *sink, + nlohmann::json moduleDb, IManaSink *sink, void *sinkContext) { ModuleDataStage result; @@ -271,7 +271,7 @@ inline void module_data_stage_process_system_event(ModuleDataStage &ctx, const u ctx.sink->process_system_event(data, size); } -struct ManaCountingSink: public ManaPlugin +struct ManaCountingSink: public IManaSink { std::vector eventCounts; std::vector>> eventArrayIndexHits; @@ -320,7 +320,6 @@ struct ManaCountingSink: public ManaPlugin } } - void process_event(uint16_t eventIndex, mana_offset_array_t *arrays, size_t arrayCount, size_t totalBytes) override { diff --git a/src/internal/mana_api.h b/src/internal/mana_api.h index bf3b9b9..4c37d43 100644 --- a/src/internal/mana_api.h +++ b/src/internal/mana_api.h @@ -1,8 +1,8 @@ #ifndef A51A04C1_ABD6_4DE9_B16A_49A9DA46C67E #define A51A04C1_ABD6_4DE9_B16A_49A9DA46C67E -#include #include +#include #ifdef __cplusplus extern "C" diff --git a/src/internal/mana_lib.hpp b/src/internal/mana_lib.hpp index e2e7990..a108ba7 100644 --- a/src/internal/mana_lib.hpp +++ b/src/internal/mana_lib.hpp @@ -126,10 +126,10 @@ inline nlohmann::json make_array_descriptor(const std::string &name, const std:: return make_array_descriptor(name, mana_float, size, bits); } -class ManaPlugin +class IManaSink { public: - virtual ~ManaPlugin() = default; + virtual ~IManaSink() = default; virtual void init() = 0; virtual void shutdown() = 0; @@ -141,19 +141,19 @@ class ManaPlugin virtual void process_system_event(const uint32_t *data, size_t size) = 0; protected: - ManaPlugin() = default; + IManaSink() = default; private: - ManaPlugin(const ManaPlugin &) = delete; - ManaPlugin &operator=(const ManaPlugin &) = delete; + IManaSink(const IManaSink &) = delete; + IManaSink &operator=(const IManaSink &) = delete; }; -struct ManaCPlugin: public ManaPlugin +struct ManaCSink: public IManaSink { mana_plugin_t plugin_; void *context_ = nullptr; - explicit ManaCPlugin(mana_plugin_t plugin) + explicit ManaCSink(mana_plugin_t plugin) : plugin_(plugin) { } diff --git a/src/tools/mana_auto_replay.cc b/src/tools/mana_auto_replay.cc index 60f94b1..98da21b 100644 --- a/src/tools/mana_auto_replay.cc +++ b/src/tools/mana_auto_replay.cc @@ -413,7 +413,7 @@ int main(int argc, char *argv[]) return 1; } - std::unique_ptr manaPlugin; + std::unique_ptr manaPlugin; boost::dll::shared_library pluginHandle; if (parser("--plugin")) @@ -422,7 +422,7 @@ int main(int argc, char *argv[]) try { pluginHandle = boost::dll::shared_library(pluginFile); - manaPlugin = std::make_unique( + manaPlugin = std::make_unique( pluginHandle.get("mana_get_plugin")()); } catch (const std::exception &e)