client-cpp  0.8.1
NotificationTransport.hpp
Go to the documentation of this file.
1 
17 #ifndef DEFAULTNOTIFICATIONTRANSPORT_HPP_
18 #define DEFAULTNOTIFICATIONTRANSPORT_HPP_
19 
20 #include <map>
21 #include <set>
22 #include <string>
23 
30 
31 namespace kaa {
32 
33 class IKaaChannelManager;
34 
35 class NotificationTransport: public AbstractKaaTransport<TransportType::NOTIFICATION>,
37 {
38 public:
40 
42 
44 
45  virtual void onNotificationResponse(const NotificationSyncResponse& response);
46 
47  virtual void onSubscriptionChanged(SubscriptionCommands&& commands);
48 
50  if (processor) {
51  notificationProcessor_ = processor;
52  }
53  }
54 
55  virtual void sync() {
57  }
58 
59 private:
60  Notifications getUnicastNotifications(const Notifications & notifications);
61  Notifications getMulticastNotifications(const Notifications & notifications);
62  std::vector<TopicState> prepareTopicStatesForRequest();
63 
64 private:
65  INotificationProcessor* notificationProcessor_;
66 
67  std::set<std::string> acceptedUnicastNotificationIds_;
68  SubscriptionCommands subscriptions_;
69 };
70 
71 } /* namespace kaa */
72 
73 #endif /* DEFAULTNOTIFICATIONTRANSPORT_HPP_ */
NotificationTransport(IKaaChannelManager &manager, IKaaClientContext &context)
virtual void setNotificationProcessor(INotificationProcessor *processor)
virtual NotificationSyncRequestPtr createEmptyNotificationRequest()
std::list< SubscriptionCommand > SubscriptionCommands
virtual NotificationSyncRequestPtr createNotificationRequest()
std::shared_ptr< NotificationSyncRequest > NotificationSyncRequestPtr
virtual void onSubscriptionChanged(SubscriptionCommands &&commands)
virtual void onNotificationResponse(const NotificationSyncResponse &response)