client-cpp  0.8.1
ProfileTransport.hpp
Go to the documentation of this file.
1 
17 #ifndef DEFAULTPROFILETRANSPORT_HPP_
18 #define DEFAULTPROFILETRANSPORT_HPP_
19 
20 #include <vector>
21 
22 #include <cstdint>
23 
28 
29 namespace kaa {
30 
31 class IKaaChannelManager;
32 
33 class ProfileTransport: public AbstractKaaTransport<TransportType::PROFILE>,
34  public IProfileTransport {
35 public:
36  ProfileTransport(IKaaChannelManager& channelManager,
37  const PublicKey& publicKey, IKaaClientContext &context);
38 
39  virtual void sync() { syncAll(); }
40 
42 
43  virtual void onProfileResponse(const ProfileSyncResponse& response);
44 
45  virtual void setProfileManager(IProfileManager* manager)
46  {
47  if (manager) {
48  profileManager_ = manager;
49  }
50  }
51 
52 private:
53  bool isProfileOutDated(const HashDigest& profileHash);
54 
55 private:
56  IProfileManager* profileManager_;
57  std::vector<std::uint8_t> publicKey_;
58 };
59 
60 } /* namespace kaa */
61 
62 #endif /* DEFAULTPROFILETRANSPORT_HPP_ */
Botan::secure_vector< std::uint8_t > PublicKey
std::vector< std::uint8_t > HashDigest
virtual void setProfileManager(IProfileManager *manager)
ProfileTransport(IKaaChannelManager &channelManager, const PublicKey &publicKey, IKaaClientContext &context)
virtual void onProfileResponse(const ProfileSyncResponse &response)
virtual ProfileSyncRequestPtr createProfileRequest()
std::shared_ptr< ProfileSyncRequest > ProfileSyncRequestPtr