diff --git a/common/DataStore.hpp b/common/DataStore.hpp index b0b5c1f..4d77b6a 100644 --- a/common/DataStore.hpp +++ b/common/DataStore.hpp @@ -2,5 +2,6 @@ #define COMMON_DATA_STORE_HPP #include "common/datastore/CDataStore.hpp" +#include "common/datastore/CDataStoreCache.hpp" #endif diff --git a/common/datastore/CDataStoreCache.hpp b/common/datastore/CDataStoreCache.hpp new file mode 100644 index 0000000..6d0ef7d --- /dev/null +++ b/common/datastore/CDataStoreCache.hpp @@ -0,0 +1,28 @@ +#ifndef COMMON_DATASTORE_C_DATA_STORE_CACHE_HPP +#define COMMON_DATASTORE_C_DATA_STORE_CACHE_HPP + +#include "common/datastore/CDataStore.hpp" +#include + +template +class CDataStoreCache : public CDataStore { + public: + // Member variables + uint8_t m_cache[size]; + + // Virtual member functions + virtual void InternalInitialize(uint8_t*& data, uint32_t& base, uint32_t& alloc); + + // Member functions + CDataStoreCache() { + this->InternalInitialize(this->m_data, this->m_base, this->m_alloc); + } +}; + +template +void CDataStoreCache::InternalInitialize(uint8_t*& data, uint32_t& base, uint32_t& alloc) { + data = this->m_cache; + alloc = size; +} + +#endif