#pragma once #include "../Interface/Types.h" #include "../Interface/Mutex.h" #include #include #include "../common/lrucache.h" class DataplanDb { public: DataplanDb(); static DataplanDb* getInstance(); static void init(); struct SDataplanItem { std::string hostname_glob; int64 limit; }; bool read(const std::string& fn); bool getLimit(const std::string& hostname, std::string& pattern, int64& limit); private: static DataplanDb* instance; std::unique_ptr mutex; std::vector items; common::lrucache cache; };