31 virtual std::shared_ptr<BaseClass>
36template <
class DerivedClass,
class BaseClass>
40 std::shared_ptr<BaseClass>
43 return std::shared_ptr<BaseClass>(
new DerivedClass(name, logLevel));
47template <
class BaseClass>
class Factory {
49 static Factory &
get() {
50 static Factory instance;
56 std::vector<std::string> items;
57 for (
auto g : functionMap) {
58 items.push_back(g.first);
64 std::shared_ptr<BaseClass>
65 create(std::string type,
const std::string &name,
68 auto it = functionMap.find(type);
69 if (it != functionMap.end())
70 return it->second->Create(name, logLevel);
77 functionMap[type] = Fn;
82 Factory(
const Factory &);
84 auto i = functionMap.begin();
85 while (i != functionMap.end()) {
91 std::map<std::string, Creator<BaseClass> *> functionMap;
Base model for Governors.
4 Order Synchronous generator model for transient stability analysis
spdlog::level::level_enum Level
Base class for SP VBR synchronous generator model single phase.
Voltage-Behind-Reactance (VBR) implementation of 3rd order synchronous generator model.
Voltage-Behind-Reactance (VBR) implementation of 4th order synchronous generator model.
Voltage-Behind-Reactance (VBR) implementation of 5th type 2 order synchronous generator model Ref: Mi...
Voltage-Behind-Reactance (VBR) implementation of 6th order synchronous generator model Marconato's mo...
Voltage-Behind-Reactance (VBR) implementation of 6th order synchronous generator model Anderson-Fouad...
virtual std::shared_ptr< BaseClass > Create(const std::string &name, CPS::Logger::Level logLevel=CPS::Logger::Level::debug)=0
std::shared_ptr< BaseClass > Create(const std::string &name, CPS::Logger::Level logLevel=CPS::Logger::Level::debug)
void registerExciter(const std::string &type, Creator< BaseClass > *Fn)
std::vector< std::string > getItems()
std::shared_ptr< BaseClass > create(std::string type, const std::string &name, CPS::Logger::Level logLevel=CPS::Logger::Level::debug)
FactoryRegistration(std::string type, Creator< BaseClass > *Fn)
void registerSynchronGenerators()
void registerSynchronGenerators()