client-cpp  0.10.0
MetaDataTransport.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 METADATATRANSPORT_HPP_
18 #define METADATATRANSPORT_HPP_
19 
20 #include <vector>
21 #include <algorithm>
22 
23 #include "kaa/KaaDefaults.hpp"
28 
29 namespace kaa {
30 
32 {
33 public:
35  : clientStatus_(status), publicKeyHash_(keyHash), timeout_(timeout) {}
36 
37  std::shared_ptr<SyncRequestMetaData> createSyncRequestMetaData()
38  {
39  std::shared_ptr<SyncRequestMetaData> request(new SyncRequestMetaData);
40 
41  request->sdkToken = SDK_TOKEN;
42  request->endpointPublicKeyHash.set_bytes(publicKeyHash_);
43  request->profileHash.set_bytes(clientStatus_->getProfileHash());
44  request->timeout.set_long(timeout_);
45 
46  return request;
47  }
48 
49 private:
50  IKaaClientStateStoragePtr clientStatus_;
51  EndpointObjectHash publicKeyHash_;
52  long timeout_;
53 };
54 
55 } // namespace kaa
56 
57 
58 #endif /* METADATATRANSPORT_HPP_ */
std::shared_ptr< SyncRequestMetaData > createSyncRequestMetaData()
std::shared_ptr< IKaaClientStateStorage > IKaaClientStateStoragePtr
const char *const SDK_TOKEN
MetaDataTransport(IKaaClientStateStoragePtr status, EndpointObjectHash &keyHash, long timeout)