i.e. allow minetestmapper to query the database for a list of blocks in a specific range (corresponding to the requested geometry), instead of always obtaining a full list off all blocks. As postgresql is the only database which supports this efficiently, this option is only effective for postgresql.
25 lines
560 B
C++
25 lines
560 B
C++
#ifndef _DB_H
|
|
#define _DB_H
|
|
|
|
#include <cstdint>
|
|
#include <vector>
|
|
#include <string>
|
|
#include <utility>
|
|
|
|
#include "types.h"
|
|
#include "BlockPos.h"
|
|
|
|
|
|
class DB {
|
|
public:
|
|
typedef std::pair<BlockPos, ustring> Block;
|
|
typedef std::vector<BlockPos> BlockPosList;
|
|
virtual const BlockPosList &getBlockPosList()=0;
|
|
virtual const BlockPosList &getBlockPosList(BlockPos, BlockPos) { return getBlockPosList(); }
|
|
virtual int getBlocksQueriedCount(void)=0;
|
|
virtual int getBlocksReadCount(void)=0;
|
|
virtual Block getBlockOnPos(const BlockPos &pos)=0;
|
|
};
|
|
|
|
#endif // _DB_H
|