33 virtual std::shared_ptr<BaseClass>
38template <
class DerivedClass,
class BaseClass>
42 std::shared_ptr<BaseClass>
45 return std::shared_ptr<BaseClass>(
new DerivedClass(name, logLevel));
49template <
class BaseClass>
class Factory {
51 static Factory &
get() {
52 static Factory instance;
58 std::vector<std::string> items;
59 for (
auto g : functionMap) {
60 items.push_back(g.first);
66 std::shared_ptr<BaseClass>
67 create(std::string type,
const std::string &name,
70 auto it = functionMap.find(type);
71 if (it != functionMap.end())
72 return it->second->Create(name, logLevel);
79 functionMap[type] = Fn;
84 Factory(
const Factory &);
86 auto i = functionMap.begin();
87 while (i != functionMap.end()) {
93 std::map<std::string, Creator<BaseClass> *> functionMap;
Base model for Governors.
4 Order Synchronous generator model for transient stability analysis
4 Order Synchronous generator model for transient stability analysis
6 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()