Class Reference for E1039 Core & Analysis Software
RoadMap.h
Go to the documentation of this file.
1 #ifndef _ROAD_MAP__H_
2 #define _ROAD_MAP__H_
3 #include <map>
4 #include "RoadListBase.h"
5 class RoadInfo;
6 
8 class RoadMap : public RoadListBase {
9  typedef std::map<int, RoadInfo*> InfoMap;
10  InfoMap m_map;
11 
12  public:
13  typedef InfoMap::iterator Iter;
14  typedef InfoMap::const_iterator ConstIter;
15 
16  RoadMap();
17  virtual ~RoadMap();
18 
19  int Size () const { return m_map.size (); }
20  ConstIter Begin() const { return m_map.begin(); }
21  ConstIter End () const { return m_map.end (); }
22  Iter Begin() { return m_map.begin(); }
23  Iter End () { return m_map.end (); }
24 
25  RoadInfo* Find(const int road) const;
26  bool Contain(const RoadMap* map) const;
27  bool ContainEnabled(const RoadMap* map) const;
28 
29  void Add(const int road, const double weight, const int count=1);
30  void Add(const RoadInfo* info);
31  void Add(const RoadMap* map);
32  void Scale(const double val);
33 
34  void AddBG(const int road, const double weight, const int count=1);
35  void AddBG(const RoadInfo* info);
36  void AddBG(const RoadMap* map);
37  void ScaleBG(const double val);
38 };
39 
40 #endif // _ROAD_MAP__H_
Class to hold one road.
Definition: RoadInfo.h:8
Base class to hold a set (list or map) of roads.
Definition: RoadListBase.h:6
Class to hold a non-ordered set (i.e. map) of roads.
Definition: RoadMap.h:8
bool ContainEnabled(const RoadMap *map) const
Definition: RoadMap.cc:34
virtual ~RoadMap()
Definition: RoadMap.cc:13
RoadMap()
Definition: RoadMap.cc:8
int Size() const
Definition: RoadMap.h:19
InfoMap::const_iterator ConstIter
Definition: RoadMap.h:14
bool Contain(const RoadMap *map) const
Definition: RoadMap.cc:26
void Add(const int road, const double weight, const int count=1)
Definition: RoadMap.cc:43
Iter Begin()
Definition: RoadMap.h:22
RoadInfo * Find(const int road) const
Definition: RoadMap.cc:21
Iter End()
Definition: RoadMap.h:23
InfoMap::iterator Iter
Definition: RoadMap.h:13
ConstIter End() const
Definition: RoadMap.h:21
void Scale(const double val)
Definition: RoadMap.cc:64
void AddBG(const int road, const double weight, const int count=1)
Definition: RoadMap.cc:69
void ScaleBG(const double val)
Definition: RoadMap.cc:90
ConstIter Begin() const
Definition: RoadMap.h:20