CARLA
RoadInfoSpeed.h
Go to the documentation of this file.
1 // Copyright (c) 2017 Computer Vision Center (CVC) at the Universitat Autonoma
2 // de Barcelona (UAB).
3 //
4 // This work is licensed under the terms of the MIT license.
5 // For a copy, see <https://opensource.org/licenses/MIT>.
6 
7 #pragma once
8 
10 
11 namespace carla {
12 namespace road {
13 namespace element {
14 
15  class RoadInfoSpeed final : public RoadInfo {
16  public:
17 
18  RoadInfoSpeed(double s, double speed)
19  : RoadInfo(s),
20  _speed(speed),
21  _type("Town") {}
22 
23  RoadInfoSpeed(double s, double speed, std::string& type)
24  : RoadInfo(s),
25  _speed(speed),
26  _type(type) {}
27  void AcceptVisitor(RoadInfoVisitor &v) final {
28  v.Visit(*this);
29  }
30 
31  double GetSpeed() const {
32  return _speed;
33  }
34 
35  std::string GetType() const{
36  return _type;
37  }
38 
39  private:
40 
41  const double _speed;
42  const std::string _type;
43  };
44 
45 } // namespace element
46 } // namespace road
47 } // namespace carla
RoadInfoSpeed(double s, double speed)
Definition: RoadInfoSpeed.h:18
This file contains definitions of common data structures used in traffic manager. ...
Definition: Carla.cpp:133
void AcceptVisitor(RoadInfoVisitor &v) final
Definition: RoadInfoSpeed.h:27
RoadInfoSpeed(double s, double speed, std::string &type)
Definition: RoadInfoSpeed.h:23