📄 database.h
字号:
#ifndef DATABASE_H_#define DATABASE_H_/* * Class for storing key value pairs * * It will use the KadC library and the KadCppApi C++ wrapper around it, * It implements the singleton interface, */#include "Logger.h"#include "KadCppApi.h"#include <string> class Database { public: // Obtains the singleton instance. static Database* getInstance(); // Closes the singleton instance. static void close(); // Searches for a key. const std::string get(const std::string& key); // Adds a key-value pair to the database. int put(const std::string& key, const std::string& value); private: // Constants /* Min number of knodes to wait for till initialized. */ const static int INIT_KNODES_COUNT = 20; // Fields static Database* instance; KadCppApi* api; Logger* log; // Constructors & destructor Database(); Database(const Database&); virtual ~Database(); // Private methods void init();};#endif /*DATABASE_H_*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -