SaltAPI  1.1
An API for the HTTPd / Zia by Salty Studio.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
ACore.cpp
Go to the documentation of this file.
1 //
2 // Created by wery_a on 09/01/17.
3 //
4 
5 #include "Module/ACore.hpp"
6 
7 namespace Module {
8  ACore::ACore(ICore &core, std::string const &name): AModule(*this, Core, name) {
9 
10  }
11 
13 
14  }
15 
16  bool ACore::Run(std::vector<std::string> const &opts, IModuleLoader *moduleLoader) {
17  m_moduleLoader = moduleLoader;
18  // TODO load module
19  return true;
20  }
21 
22  IConfig const& ACore::GetConfig() const {
23  return *m_config;
24  }
25 
26  IModule* ACore::Get(std::string const &name) const {
27  return m_moduleLoader->Get(name);
28  }
29 
31  return m_moduleLoader->Get(type);
32  }
33 
34  IModule* ACore::GetModule(ICore &core) const {
35  return new ACore(core, "Core");
36  }
37 }
bool Run(std::vector< std::string > const &opts, IModuleLoader *moduleLoader) override
Definition: ACore.cpp:16
virtual ~ACore()
Definition: ACore.cpp:12
IModule * Get(std::string const &name) const override
Get the module by name from the list in ModuleLoader.
Definition: ACore.cpp:26
IModuleLoader * m_moduleLoader
Definition: ACore.hpp:28
virtual IModule * GetModule(ICore &core) const override
The function return an instance of the module.
Definition: ACore.cpp:34
This class is for the config It's use to store a pointer of the config in the Core You have to dynami...
virtual Module::IModule * Get(std::string const &name) const =0
ACore(ICore &core, std::string const &name)
Definition: ACore.cpp:8
IConfig const & GetConfig() const override
Definition: ACore.cpp:22
IConfig * m_config
Definition: ACore.hpp:34