All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
AttemptFittingPredicate.h
1 //
2 // AttemptFittingPredicate.h
3 // apps-on-maps
4 //
5 
6 #ifndef apps_on_maps_AttemptFittingPredicate_h
7 #define apps_on_maps_AttemptFittingPredicate_h
8 
9 #include "Routes.h"
10 #include "ClippedRouteSection.h"
11 
12 namespace Eegeo
13 {
14  namespace Routes
15  {
16  namespace Fitting
17  {
18  namespace NavGraphConforming
19  {
20  class AttemptFittingPredicate : public std::unary_function<Clipping::ClippedRouteSection, bool>
21  {
22  public:
23 
24  AttemptFittingPredicate(const Route& route,
25  const NavGraphFittingInfoRepository& roadNavGraphFittingInfoRepository,
26  const NavGraphFittingInfoRepository& railNavGraphFittingInfoRepository)
27  : m_route(route)
28  , m_roadNavGraphFittingInfoRepository(roadNavGraphFittingInfoRepository)
29  , m_railNavGraphFittingInfoRepository(railNavGraphFittingInfoRepository)
30  {
31 
32  }
33 
34  bool operator() (const Clipping::ClippedRouteSection& clippedRouteSection) const
35  {
36  return ShouldAttemptFitting(clippedRouteSection);
37  }
38 
39 
40  private:
41  bool ShouldAttemptFitting(const Clipping::ClippedRouteSection& clippedRouteSection) const;
42 
43 
44  const Route& m_route;
45  const NavGraphFittingInfoRepository& m_roadNavGraphFittingInfoRepository;
46  const NavGraphFittingInfoRepository& m_railNavGraphFittingInfoRepository;
47  };
48  }
49  }
50  }
51 }
52 
53 #endif