minetest-mapper-cpp/db-redis.h
Rogier d707b882e8 Add redis database backend (port of sfan5's patches)
Patches included/ported:
	2553e44e8dec75d99408b56f469ff4be61c84336
	79d338a90c1a99fce9334bea5d4c296f190373fc
2014-05-22 10:41:48 +02:00

25 lines
551 B
C++

#ifndef DB_REDIS_HEADER
#define DB_REDIS_HEADER
#include "db.h"
#include <hiredis.h>
class DBRedis : public DB {
public:
DBRedis(const std::string &mapdir);
virtual int getBlocksUnCachedCount(void);
virtual int getBlocksCachedCount(void);
virtual int getBlocksReadCount(void);
virtual const BlockPosList &getBlockPos();
virtual Block getBlockOnPos(const BlockPos &pos);
~DBRedis();
private:
int m_blocksReadCount;
int m_blocksUnCachedCount;
redisContext *ctx;
std::string hash;
BlockPosList m_blockPosList;
};
#endif // DB_REDIS_HEADER