client-cpp  0.8.1
SingleThreadExecutorContext.hpp
Go to the documentation of this file.
1 
17 #ifndef SINGLETHREADEXECUTORCONTEXT_HPP_
18 #define SINGLETHREADEXECUTORCONTEXT_HPP_
19 
21 
22 namespace kaa {
23 
25 public:
28 
29  virtual IThreadPool& getLifeCycleExecutor() { return *executor_; }
30  virtual IThreadPool& getApiExecutor() { return *executor_; }
31  virtual IThreadPool& getCallbackExecutor() { return *executor_; }
32 
33 protected:
34  virtual void doInit() { executor_ = createExecutor(1); }
35  virtual void doStop() { shutdownExecutor(executor_); }
36 
37 private:
38  IThreadPoolPtr executor_;
39 };
40 
41 } /* namespace kaa */
42 
43 #endif /* SINGLETHREADEXECUTORCONTEXT_HPP_ */
void shutdownExecutor(IThreadPoolPtr threadPool)
std::shared_ptr< IThreadPool > IThreadPoolPtr
Definition: IThreadPool.hpp:40
IThreadPoolPtr createExecutor(std::size_t threadCount)