init
This commit is contained in:
24
include/kms/kms_factory.hpp
Executable file
24
include/kms/kms_factory.hpp
Executable file
@@ -0,0 +1,24 @@
|
||||
// kms_factory.hpp
|
||||
#ifndef KMS_FACTORY_HPP
|
||||
#define KMS_FACTORY_HPP
|
||||
|
||||
#include "kms_interface.hpp"
|
||||
|
||||
class KmsFactory {
|
||||
public:
|
||||
using CreatorFunc = std::function<std::unique_ptr<IKmsCore>(const IKmsConfig &)>;
|
||||
|
||||
static KmsFactory& instance();
|
||||
|
||||
void registerCreator(const std::string& name, CreatorFunc func);
|
||||
|
||||
std::unique_ptr<IKmsCore> create(const IKmsConfig& config) const;
|
||||
|
||||
std::vector<std::string> listRegistered() const;
|
||||
|
||||
private:
|
||||
std::unordered_map<std::string, CreatorFunc> creators_;
|
||||
};
|
||||
|
||||
|
||||
#endif // KMS_FACTORY_HPP
|
||||
Reference in New Issue
Block a user