From d285287be54fb4d0c05f29f779c40d1e6331637c Mon Sep 17 00:00:00 2001 From: Dario Date: Fri, 28 Aug 2020 12:36:02 +0200 Subject: [PATCH] extend memory bin to get access of part of data, for example copy the last half of it --- src/cpp/SingletonManager/MemoryManager.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/cpp/SingletonManager/MemoryManager.h b/src/cpp/SingletonManager/MemoryManager.h index 7cb9233f7..591148083 100644 --- a/src/cpp/SingletonManager/MemoryManager.h +++ b/src/cpp/SingletonManager/MemoryManager.h @@ -18,6 +18,7 @@ #include #include +#include #define MEMORY_MANAGER_PAGE_SIZE 10 @@ -41,6 +42,8 @@ public: inline unsigned char* data() { return mData; } inline const unsigned char* data() const { return mData; } + inline unsigned char* data(size_t startIndex) { assert(startIndex < mSize); return &mData[startIndex]; } + inline const unsigned char* data(size_t startIndex) const { assert(startIndex < mSize); return &mData[startIndex]; } std::string convertToHex(); //! \return 0 if ok //! -1 if bin is to small