client-cpp
0.10.0
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
SingleThreadExecutorContext.hpp
Go to the documentation of this file.
1
/*
2
* Copyright 2014-2016 CyberVision, Inc.
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*/
16
17
#ifndef SINGLETHREADEXECUTORCONTEXT_HPP_
18
#define SINGLETHREADEXECUTORCONTEXT_HPP_
19
20
#include "
kaa/context/AbstractExecutorContext.hpp
"
21
22
namespace
kaa {
23
24
class
SingleThreadExecutorContext
:
public
AbstractExecutorContext
{
25
public
:
26
SingleThreadExecutorContext
()
27
:
AbstractExecutorContext
() {}
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_ */
kaa::SingleThreadExecutorContext::getLifeCycleExecutor
virtual IThreadPool & getLifeCycleExecutor()
Definition:
SingleThreadExecutorContext.hpp:29
kaa::SingleThreadExecutorContext::getCallbackExecutor
virtual IThreadPool & getCallbackExecutor()
Definition:
SingleThreadExecutorContext.hpp:31
kaa::SingleThreadExecutorContext::doStop
virtual void doStop()
Definition:
SingleThreadExecutorContext.hpp:35
AbstractExecutorContext.hpp
kaa::AbstractExecutorContext::shutdownExecutor
void shutdownExecutor(IThreadPoolPtr threadPool)
Definition:
AbstractExecutorContext.hpp:57
kaa::SingleThreadExecutorContext
Definition:
SingleThreadExecutorContext.hpp:24
kaa::SingleThreadExecutorContext::SingleThreadExecutorContext
SingleThreadExecutorContext()
Definition:
SingleThreadExecutorContext.hpp:26
kaa::IThreadPoolPtr
std::shared_ptr< IThreadPool > IThreadPoolPtr
Definition:
IThreadPool.hpp:68
kaa::SingleThreadExecutorContext::getApiExecutor
virtual IThreadPool & getApiExecutor()
Definition:
SingleThreadExecutorContext.hpp:30
kaa::AbstractExecutorContext
Definition:
AbstractExecutorContext.hpp:28
kaa::AbstractExecutorContext::createExecutor
IThreadPoolPtr createExecutor(std::size_t threadCount)
Definition:
AbstractExecutorContext.hpp:52
kaa::SingleThreadExecutorContext::doInit
virtual void doInit()
Definition:
SingleThreadExecutorContext.hpp:34
kaa::IThreadPool
Definition:
IThreadPool.hpp:28
architec
Documents
kaa
client
client-multi
client-cpp
kaa
context
SingleThreadExecutorContext.hpp
Generated on Mon Oct 31 2016 16:51:43 for client-cpp by
1.8.6