client-cpp  0.7.0
EventTransport.hpp
Go to the documentation of this file.
1 /*
2  * Copyright 2014 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 EVENTTRANSPORT_HPP_
18 #define EVENTTRANSPORT_HPP_
19 
20 #include "kaa/KaaDefaults.hpp"
21 #include "kaa/KaaThread.hpp"
22 #include "kaa/gen/EndpointGen.hpp"
25 #include "kaa/KaaThread.hpp"
26 
27 namespace kaa {
28 
29 class IEventDataProcessor;
30 class IKaaChannelManager;
31 
32 class EventTransport : public AbstractKaaTransport<TransportType::EVENT>, public IEventTransport {
33 public:
35 
36  std::shared_ptr<EventSyncRequest> createEventRequest(std::int32_t requestId);
37 
38  void onEventResponse(const EventSyncResponse& response);
39  void onSyncResponseId(std::int32_t requestId);
40 
41  void sync();
42 
43 private:
44  KAA_MUTEX_DECLARE(eventsGuard_);
45 
46  IEventDataProcessor& eventDataProcessor_;
47  std::map<std::uint32_t, std::list<Event> > events_;
48 
49  std::int32_t startEventSN_;
50  bool_type isEventSNSynchronized_;
51 
52 };
53 
54 } // namespace kaa
55 
56 #endif /* EVENTTRANSPORT_HPP_ */
EventTransport(IEventDataProcessor &eventManager, IKaaChannelManager &channelManager, IKaaClientStateStoragePtr state)
std::shared_ptr< EventSyncRequest > createEventRequest(std::int32_t requestId)
std::shared_ptr< IKaaClientStateStorage > IKaaClientStateStoragePtr
bool bool_type
Definition: KaaThread.hpp:81
void onSyncResponseId(std::int32_t requestId)
void onEventResponse(const EventSyncResponse &response)