SaltAPI  1.1
An API for the HTTPd / Zia by Salty Studio.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
ACore.hpp
Go to the documentation of this file.
1 //
2 // Created by wery_a on 07/01/17.
3 //
4 
5 #ifndef API_V2_ACORE_HPP
6 #define API_V2_ACORE_HPP
7 
8 #include "AModule.hpp"
9 #include "ICore.hpp"
10 #include "IModuleLoader.hpp"
11 
12 namespace Module {
13  class IConfigLoader;
14 
15  class ILogger;
16 
17  class INetwork;
18 
19  class IFileServe;
20 
21  class ACore : public ICore, public AModule {
22  public:
23  ACore(ICore &core, std::string const &name);
24 
25  virtual ~ACore();
26 
27  protected:
30  ILogger *m_logger = nullptr;
31  INetwork *m_network = nullptr;
32  IFileServe *m_fileServe = nullptr;
33 
34  IConfig *m_config = nullptr;
35  protected:
36 
37 
38  public:
39  bool Run(std::vector<std::string> const &opts, IModuleLoader *moduleLoader) override;
40 
41  IConfig const &GetConfig() const override;
42 
43  public:
44  IModule *Get(std::string const &name) const override;
45 
46  IModule *Get(IModule::Type type) const override;
47 
48  public:
49  virtual IModule *GetModule(ICore &core) const override;
50  };
51 }
52 #endif //API_V2_ACORE_HPP
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
IFileServe * m_fileServe
Definition: ACore.hpp:32
IConfigLoader * m_configLoader
Definition: ACore.hpp:29
ILogger * m_logger
Definition: ACore.hpp:30
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...
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
INetwork * m_network
Definition: ACore.hpp:31