From 169bea55befd4d656469d14e458aabd5543f955d Mon Sep 17 00:00:00 2001 From: Maschell Date: Sun, 17 May 2020 21:07:26 +0200 Subject: [PATCH] Allow direct access to plugin data buffers --- source/plugin/PluginData.h | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/source/plugin/PluginData.h b/source/plugin/PluginData.h index 6f26979..0f3ebb5 100644 --- a/source/plugin/PluginData.h +++ b/source/plugin/PluginData.h @@ -44,30 +44,34 @@ public: } } - void freeMemory(); -private: + void *getBuffer() const { + return this->buffer; + } + PluginData(const PluginData &obj); PluginData() { } + void *buffer; + MEMHeapHandle heapHandle; + eMemoryTypes memoryType; + size_t length; + +private: PluginData(std::vector buffer); PluginData(std::vector input, MEMHeapHandle heapHandle, eMemoryTypes memoryType); - void loadReader(); static std::optional createFromExistingData(const void *buffer, MEMHeapHandle heapHandle, eMemoryTypes memoryType, const size_t length); std::optional reader; + elfio *nReader = NULL; - void *buffer; - MEMHeapHandle heapHandle; - eMemoryTypes memoryType; - size_t length; friend class PluginDataFactory;