24 #include <boost/preprocessor.hpp>
28 #define X_DEFINE_ENUM_WITH_STRING_CONVERSIONS_TOSTRING_CASE(r, data, elem) \
30 return BOOST_PP_STRINGIZE(elem);
32 #define DEFINE_ENUM_WITH_STRING_CONVERSIONS(name, enumerators) \
33 enum name { BOOST_PP_SEQ_ENUM(enumerators) }; \
35 inline const char* ToString(name v) { \
37 BOOST_PP_SEQ_FOR_EACH( \
38 X_DEFINE_ENUM_WITH_STRING_CONVERSIONS_TOSTRING_CASE, name, enumerators) \
40 return "[Unknown " BOOST_PP_STRINGIZE(name) "]"; \
46 (CACHING_FILE_MGR)(FILE_MGR)(CPU_MGR)(GPU_MGR)(GLOBAL_FILE_MGR)(PERSISTENT_STORAGE_MGR)(FOREIGN_STORAGE_MGR)(TIERED_CPU_MGR))
48 namespace Data_Namespace {
68 virtual AbstractBuffer* createBuffer(
const ChunkKey& key,
69 const size_t pageSize = 0,
70 const size_t initialSize = 0) = 0;
71 virtual void deleteBuffer(
73 const bool purge =
true) = 0;
74 virtual void deleteBuffersWithPrefix(
const ChunkKey& keyPrefix,
75 const bool purge =
true) = 0;
76 virtual AbstractBuffer* getBuffer(
const ChunkKey& key,
const size_t numBytes = 0) = 0;
77 virtual void fetchBuffer(
const ChunkKey& key,
78 AbstractBuffer* destBuffer,
79 const size_t numBytes = 0) = 0;
80 virtual AbstractBuffer* putBuffer(
const ChunkKey& key,
81 AbstractBuffer* srcBuffer,
82 const size_t numBytes = 0) = 0;
86 virtual bool isBufferOnDevice(
const ChunkKey& key) = 0;
87 virtual std::string printSlabs() = 0;
88 virtual size_t getMaxSize() = 0;
89 virtual size_t getInUseSize() = 0;
90 virtual size_t getAllocated() = 0;
91 virtual bool isAllocationCapped() = 0;
93 virtual void checkpoint() = 0;
94 virtual void checkpoint(
const int db_id,
const int tb_id) = 0;
95 virtual void removeTableRelatedDS(
const int db_id,
const int table_id) = 0;
98 virtual AbstractBuffer* alloc(
const size_t numBytes = 0) = 0;
99 virtual void free(AbstractBuffer* buffer) = 0;
100 virtual MgrType getMgrType() = 0;
101 virtual std::string getStringMgrType() = 0;
102 virtual size_t getNumChunks() = 0;
103 inline int getDeviceId() {
return device_id_; }
std::vector< int > ChunkKey
#define DEFINE_ENUM_WITH_STRING_CONVERSIONS(name, enumerators)