All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
TrafficCongestionStateChangedCallback.h
1 // Copyright (c) 2014 eeGeo. All rights reserved.
2 
3 #pragma once
4 
5 #include "TrafficCongestionModelCell.h"
6 
7 namespace Eegeo
8 {
9  namespace TrafficCongestion
10  {
12  {
13  public:
14  virtual void operator()(const TrafficCongestionModelCell& changed) = 0;
15  };
16 
17  template<typename T>
19  {
20  private:
21  void (T::*m_callback)(const TrafficCongestionModelCell& changed);
22 
23  T* m_context;
24  public:
26  T* context,
27  void (T::*callback)(const TrafficCongestionModelCell& changed))
28  : m_callback(callback)
29  , m_context(context)
30  {
31  }
32 
33  virtual void operator()(const TrafficCongestionModelCell& changed)
34  {
35  (*m_context.*m_callback)(changed);
36  }
37  };
38  }
39 }