identt
ServerBase.hpp
Go to the documentation of this file.
1 
33 #ifndef _IDENTT_UTILS_SERVERBASE_HPP_
34 #define _IDENTT_UTILS_SERVERBASE_HPP_
35 
36 #include "BaseUtils.hpp"
37 
38 #include <csignal>
39 #include <vector>
40 #include <memory>
41 #include <initializer_list>
42 #include "SharedTable.hpp"
43 
44 namespace identt {
45 namespace utils {
46 class ServerBase {
47 public:
48  using ParamsListT=std::vector<std::string>;
49 
54  ServerBase(const ServerBase&) = delete;
55  ServerBase& operator=(const ServerBase&) = delete;
56 
60  virtual ~ServerBase () {}
61 
71  virtual void init(ParamsListT params)=0;
72 
79  const static std::string GetSection();
80 
87  const static ParamsListT GetRequire();
88 
95  virtual void stop()=0;
96 
97 protected:
98  bool is_init;
99  SharedTable::pointer sharedtable;
100 
110  ServerBase(SharedTable::pointer sharedtable_)
111  : is_init(false),
112  sharedtable(sharedtable_->share())
113  {}
114 
115 };
116 } // namespace utils
117 } // namespace identt
118 
119 #endif /* _IDENTT_UTILS_SERVERBASE_HPP_ */
ServerBase(const ServerBase &)=delete
make noncopyable
Definition: CryptoBase.hpp:49
virtual void init(ParamsListT params)=0
init : initialize
virtual void stop()=0
stop : shutdown
static const ParamsListT GetRequire()
GetRequire : parameters required.
ServerBase(SharedTable::pointer sharedtable_)
Constructor : private.
Definition: ServerBase.hpp:110
static const std::string GetSection()
GetSection : section required.
virtual ~ServerBase()
destructor
Definition: ServerBase.hpp:60
Definition: ServerBase.hpp:46