All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
AsyncLoadedInteriorLabelAnchorCategoryMapper.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include "IInteriorLabelAnchorCategoryMapper.h"
6 #include "Types.h"
7 #include "Labels.h"
8 #include "LabelLayer.h"
9 #include "LabelAnchorCategory.h"
10 #include "CallbackCollection.h"
11 #include "IInteriorLabelAnchorCategoryMapperFactory.h"
12 
13 
14 
15 
16 namespace Eegeo
17 {
18  namespace Resources
19  {
20  namespace Interiors
21  {
22  namespace Builder
23  {
24  // Wrapper type allowing deferred creation of IInteriorLabelAnchorCategoryMapper instance, pending data fetch / load.
25  // An implementation of IInteriorLabelAnchorCategoryMapper returns NULL for GetAnchorCategory until it receives callback
26  // with InteriorLabelCategoryParserResult, allowing it to construct an InteriorLabelAnchorCategoryMapper instance.
28  {
29  public:
31  const Labels::LabelLayer::IdType& labelLayerId,
32  const std::string& defaultCategoryId,
35 
37 
38  const Labels::LabelAnchorCategory* GetAnchorCategory(const Entities::InteriorsEntityMetadata& interiorEntityMetadata) const;
39 
40  private:
41  void OnInteriorLabelCategoryLoaded(const InteriorLabelCategoryParserResult& parserResult);
42 
43  void RegisterDefaultCategory();
44  void UnregisterDefaultCategory();
45 
46  Labels::ILabelAnchorCategoryRepository& m_labelAnchorCategoryRepository;
47  const Labels::LabelLayer::IdType m_labelLayerId;
48  const std::string m_defaultCategory;
50  Helpers::CallbackCollection1<const InteriorLabelCategoryParserResult>& m_interiorLabelCategoryLoaderObserver;
53  };
54  }
55  }
56  }
57 }