client-cpp  0.7.0
ConfigurationPersistenceManager.hpp
Go to the documentation of this file.
1 /*
2  * Copyright 2014-2015 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 CONFIGURATIONPERSISTENCEMANAGER_HPP_
18 #define CONFIGURATIONPERSISTENCEMANAGER_HPP_
19 
20 #include "kaa/KaaThread.hpp"
26 
27 namespace kaa {
28 
29 class IKaaClientStateStorage;
30 
41 public:
43  : processor_(nullptr)
44  , ignoreConfigurationUpdate_(false)
45  , state_(state)
46  {}
48 
53 
57  void onConfigurationUpdated(const KaaRootConfiguration &configuration);
58 
63 
71 private:
72  void readStoredConfiguration();
73 
74  KAA_MUTEX_DECLARE(confPersistenceGuard_);
75 
76  IConfigurationStoragePtr storage_;
77  IConfigurationProcessor* processor_;
78 
79  EndpointObjectHash configurationHash_;
80  bool_type ignoreConfigurationUpdate_;
81 
83 };
84 
85 } // namespace kaa
86 
87 #endif /* CONFIGURATIONPERSISTENCEMANAGER_HPP_ */
ConfigurationPersistenceManager(IKaaClientStateStoragePtr state)
void onConfigurationUpdated(const KaaRootConfiguration &configuration)
std::shared_ptr< IKaaClientStateStorage > IKaaClientStateStoragePtr
std::shared_ptr< IConfigurationStorage > IConfigurationStoragePtr
EndpointObjectHash getConfigurationHash()
void setConfigurationStorage(IConfigurationStoragePtr storage)
void setConfigurationProcessor(IConfigurationProcessor *processor)
bool bool_type
Definition: KaaThread.hpp:81