Optimize updateFastFaceRow processing by removing some TileSpec copy (#5678)
[oweals/minetest.git] / src / database-leveldb.h
index 5d44ba3e7a2ed8e2b679dbf20f82b60946f14fd0..52ccebe70a4c7ea99a35e366bc3ad13082eb0cfd 100644 (file)
@@ -24,27 +24,27 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 
 #if USE_LEVELDB
 
+#include <string>
 #include "database.h"
 #include "leveldb/db.h"
-#include <string>
 
-class ServerMap;
-
-class Database_LevelDB : public Database
+class Database_LevelDB : public MapDatabase
 {
 public:
-       Database_LevelDB(ServerMap *map, std::string savedir);
-       virtual void beginSave();
-       virtual void endSave();
-       virtual bool saveBlock(v3s16 blockpos, std::string &data);
-       virtual std::string loadBlock(v3s16 blockpos);
-       virtual bool deleteBlock(v3s16 blockpos);
-       virtual void listAllLoadableBlocks(std::vector<v3s16> &dst);
-       virtual int Initialized(void);
+       Database_LevelDB(const std::string &savedir);
        ~Database_LevelDB();
+
+       bool saveBlock(const v3s16 &pos, const std::string &data);
+       void loadBlock(const v3s16 &pos, std::string *block);
+       bool deleteBlock(const v3s16 &pos);
+       void listAllLoadableBlocks(std::vector<v3s16> &dst);
+
+       void beginSave() {}
+       void endSave() {}
 private:
-       ServerMap *srvmap;
-       leveldb::DB* m_database;
+       leveldb::DB *m_database;
 };
-#endif
+
+#endif // USE_LEVELDB
+
 #endif