All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
NavigationGraphAddedCallback.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include "Navigation.h"
6 
7 namespace Eegeo
8 {
9  namespace Resources
10  {
11  namespace Roads
12  {
13  namespace Navigation
14  {
16  {
17  public:
18  virtual void operator()(const NavigationGraph& navGraph) = 0;
19  };
20 
22  {
23  private:
24  void (T::*m_callback)(const NavigationGraph& navGraph);
25  T* m_context;
26  public:
27  TNavigationGraphAddedCallback(T* context, void (T::*callback)(const NavigationGraph& navGraph))
28  : m_callback(callback)
29  , m_context(context)
30  {
31  }
32 
33  virtual void operator()(const NavigationGraph& navGraph)
34  {
35  (*m_context.*m_callback)(navGraph);
36  }
37  };
38  }
39  }
40  }
41 }