7 #ifndef REACTOR_FACTORY_H
8 #define REACTOR_FACTORY_H
22 static ReactorFactory* factory() {
23 ScopedLock lock(reactor_mutex);
25 s_factory =
new ReactorFactory;
30 virtual void deleteFactory() {
31 ScopedLock lock(reactor_mutex);
41 virtual ~ReactorFactory() {}
47 virtual ReactorBase* newReactor(
int n);
48 virtual ReactorBase* newReactor(std::string reactorType);
51 static ReactorFactory* s_factory;
52 static mutex_t reactor_mutex;
56 inline ReactorBase* newReactor(std::string model,
60 f = ReactorFactory::factory();
62 return f->newReactor(model);