All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
CandidateSet.h
1 // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
2 
3 #pragma once
4 
5 #include "Types.h"
6 #include "Routes.h"
7 #include "LocalRouteVertex.h"
8 #include "Candidate.h"
9 #include <vector>
10 
11 namespace Eegeo
12 {
13  namespace Routes
14  {
15  namespace Fitting
16  {
17  namespace NavGraphConforming
18  {
19 
21  {
22  public:
23  CandidateSet(const LocalRouteVertex& localRouteVertex,
24  const std::vector<Candidate*>& candidates,
25  int index);
26 
27  const LocalRouteVertex& SrcVertex() const { return m_localRouteVertex; }
28 
29  std::vector<Candidate*>& candidates() { return m_candidates; }
30  const std::vector<Candidate*>& GetCandidates() const { return m_candidates; }
31 
32  bool HasConformCandidates() const;
33 
34 
35  const Candidate* GetUnfittedCandidate() const { return &m_unfittedCandidate; }
36 
37  int GetIndex() const { return m_index; }
38 
39  bool IsInputInCentralCell() const { return m_localRouteVertex.IsInCentralCell(); }
40 
41  const CandidateSet* GetNextCandidateSet(const std::vector<const CandidateSet*>& candidateSets) const
42  {
43  int nextIndex = m_index + 1;
44  if (nextIndex >= candidateSets.size())
45  {
46  return NULL;
47  }
48  return candidateSets.at(nextIndex);
49  }
50 
51  static CandidateSet* CreateDeepCopy(const CandidateSet& src, int newIndex);
52 
53  private:
54  void FixUpCandidatesPointers();
55 
56  LocalRouteVertex m_localRouteVertex;
57  std::vector<Candidate*> m_candidates;
58  Candidate m_unfittedCandidate;
59 
60  int m_index;
61  };
62  }
63  }
64  }
65 }