Allow direct access to plugin data buffers

This commit is contained in:
Maschell 2020-05-17 21:07:26 +02:00
parent 192b00baae
commit 169bea55be

View File

@ -44,30 +44,34 @@ public:
} }
} }
void freeMemory(); void freeMemory();
private: void *getBuffer() const {
return this->buffer;
}
PluginData(const PluginData &obj); PluginData(const PluginData &obj);
PluginData() { PluginData() {
} }
void *buffer;
MEMHeapHandle heapHandle;
eMemoryTypes memoryType;
size_t length;
private:
PluginData(std::vector<uint8_t> buffer); PluginData(std::vector<uint8_t> buffer);
PluginData(std::vector<uint8_t> input, MEMHeapHandle heapHandle, eMemoryTypes memoryType); PluginData(std::vector<uint8_t> input, MEMHeapHandle heapHandle, eMemoryTypes memoryType);
void loadReader(); void loadReader();
static std::optional<PluginData> createFromExistingData(const void *buffer, MEMHeapHandle heapHandle, eMemoryTypes memoryType, const size_t length); static std::optional<PluginData> createFromExistingData(const void *buffer, MEMHeapHandle heapHandle, eMemoryTypes memoryType, const size_t length);
std::optional<elfio *> reader; std::optional<elfio *> reader;
elfio *nReader = NULL; elfio *nReader = NULL;
void *buffer;
MEMHeapHandle heapHandle;
eMemoryTypes memoryType;
size_t length;
friend class PluginDataFactory; friend class PluginDataFactory;