client-cpp  0.9.0
KaaClientContext.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 KAACLIENTCONTEXT_H
18 #define KAACLIENTCONTEXT_H
19 
20 #include "IKaaClientContext.hpp"
21 #include <kaa/ClientStatus.hpp>
22 #include <kaa/KaaClientContext.hpp>
23 
25 #include <kaa/logging/ILogger.hpp>
28 
29 
30 namespace kaa {
31 
33 {
34 public:
36  IExecutorContext &executorContext, IKaaClientStateStoragePtr state = nullptr)
37  : properties_(properties), logger_(logger), executorContext_(executorContext), state_(state) {}
38 
39  virtual KaaClientProperties &getProperties() { return properties_; }
40  virtual ILogger &getLogger() { return logger_; }
41  virtual IKaaClientStateStorage &getStatus() { return *state_; }
42  virtual IExecutorContext &getExecutorContext() { return executorContext_; }
43  void setStatus(IKaaClientStateStoragePtr status) { state_ = status; }
44 
45 private:
46  KaaClientProperties &properties_;
47  ILogger &logger_;
48  IExecutorContext &executorContext_;
50 };
51 
52 }
53 
54 
55 #endif // KAACLIENTCONTEXT_H
virtual KaaClientProperties & getProperties()
void setStatus(IKaaClientStateStoragePtr status)
virtual IKaaClientStateStorage & getStatus()
virtual ILogger & getLogger()
std::shared_ptr< IKaaClientStateStorage > IKaaClientStateStoragePtr
virtual IExecutorContext & getExecutorContext()
KaaClientContext(KaaClientProperties &properties, ILogger &logger, IExecutorContext &executorContext, IKaaClientStateStoragePtr state=nullptr)