All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
InteriorEntitiesWebService.h
1 // Copyright eeGeo Ltd (2012-2018), All Rights Reserved
2 
3 #pragma once
4 
5 #include "IInteriorEntitiesWebService.h"
6 #include "Interiors.h"
7 #include "Web.h"
8 #include "WebLoadRequestCompletionCallback.h"
9 #include "CallbackCollection.h"
10 #include <string>
11 #include <map>
12 
13 namespace Eegeo
14 {
15  namespace Resources
16  {
17  namespace Interiors
18  {
19  namespace Webservice
20  {
22  {
23  public:
24 
26  const std::string& serviceUrlBase,
27  const Web::ApiTokenModel& apiTokenModel);
29 
30  void SetServiceUrl(const std::string& serviceUrlBase);
31 
32  InteriorEntitiesRequestId RequestEntitiesForFloor(const InteriorId& indoorId,
33  int floorId);
34  void CancelRequest(InteriorEntitiesRequestId requestId);
35 
36  void RegisterRequestCompletedCallback(InteriorEntitiesRequestCompletedCallback& callback);
37  void UnregisterRequestCompletedCallback(InteriorEntitiesRequestCompletedCallback& callback);
38 
39  private:
40 
41  void OnRequestComplete(Web::IWebResponse& webResponse);
42  InteriorEntitiesRequestId NextRequestId();
43 
44  Web::IWebLoadRequestFactory& m_webRequestFactory;
45  const Web::ApiTokenModel& m_apiTokenModel;
46 
47  std::map<InteriorEntitiesRequestId, Web::IWebLoadRequest*> m_webRequests;
50 
51  std::string m_serviceUrlBase;
52  InteriorEntitiesRequestId m_nextId;
53  };
54  }
55  }
56  }
57 }