scenario_simulator_v2 C++ API
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Friends | List of all members
traffic_simulator::TrafficLight::Shape Struct Reference

#include <traffic_light.hpp>

Public Types

enum class  Category : std::uint8_t { circle , cross , arrow }
 
enum  Value : std::uint16_t {
  circle = static_cast<std::uint8_t>(Category::circle) , circle , cross = static_cast<std::uint8_t>(Category::cross ) , cross ,
  left = (0b0000'1000 << 8) | static_cast<std::uint8_t>(Category::arrow ) , down = (0b0000'0100 << 8) | static_cast<std::uint8_t>(Category::arrow ) , up = (0b0000'0010 << 8) | static_cast<std::uint8_t>(Category::arrow ) , right = (0b0000'0001 << 8) | static_cast<std::uint8_t>(Category::arrow ) ,
  lower_left = (0b0000'1100 << 8) | static_cast<std::uint8_t>(Category::arrow ) , upper_left = (0b0000'1010 << 8) | static_cast<std::uint8_t>(Category::arrow ) , lower_right = (0b0000'0101 << 8) | static_cast<std::uint8_t>(Category::arrow ) , upper_right = (0b0000'0011 << 8) | static_cast<std::uint8_t>(Category::arrow )
}
 

Public Member Functions

constexpr Shape (const Value value=circle)
 
 Shape (const std::string &name)
 
constexpr auto category () const
 
constexpr auto is (const Value given) const
 
constexpr auto is (const Category given) const
 
constexpr operator Value () const noexcept
 

Static Public Member Functions

static auto make (const std::string &name) -> Shape
 

Public Attributes

enum traffic_simulator::TrafficLight::Shape::Value value
 

Static Public Attributes

static const std::unordered_map< std::string, Shape::Valuetable
 

Friends

auto operator>> (std::istream &is, Shape &shape) -> std::istream &
 
auto operator<< (std::ostream &os, const Shape &shape) -> std::ostream &
 

Member Enumeration Documentation

◆ Category

Enumerator
circle 
cross 
arrow 

◆ Value

Enumerator
circle 
circle 
cross 
cross 
left 
down 
up 
right 
lower_left 
upper_left 
lower_right 
upper_right 

Constructor & Destructor Documentation

◆ Shape() [1/2]

constexpr traffic_simulator::TrafficLight::Shape::Shape ( const Value  value = circle)
inlineconstexpr

◆ Shape() [2/2]

traffic_simulator::TrafficLight::Shape::Shape ( const std::string &  name)
inline

Member Function Documentation

◆ category()

constexpr auto traffic_simulator::TrafficLight::Shape::category ( ) const
inlineconstexpr

◆ is() [1/2]

constexpr auto traffic_simulator::TrafficLight::Shape::is ( const Category  given) const
inlineconstexpr

◆ is() [2/2]

constexpr auto traffic_simulator::TrafficLight::Shape::is ( const Value  given) const
inlineconstexpr

◆ make()

auto traffic_simulator::TrafficLight::Shape::make ( const std::string &  name) -> Shape
static

◆ operator Value()

constexpr traffic_simulator::TrafficLight::Shape::operator Value ( ) const
inlineconstexprnoexcept

Friends And Related Function Documentation

◆ operator<<

auto operator<< ( std::ostream &  os,
const Shape shape 
) -> std::ostream &
friend

◆ operator>>

auto operator>> ( std::istream &  is,
TrafficLight::Shape shape 
) -> std::istream &
friend

Member Data Documentation

◆ table

const std::unordered_map<std::string, Shape::Value> traffic_simulator::TrafficLight::Shape::table
inlinestatic
Initial value:
{
std::make_pair("circle", Shape::circle),
std::make_pair("cross", Shape::cross),
std::make_pair("left", Shape::left),
std::make_pair("down", Shape::down),
std::make_pair("up", Shape::up),
std::make_pair("right", Shape::right),
std::make_pair("lowerLeft", Shape::lower_left),
std::make_pair("upperLeft", Shape::upper_left),
std::make_pair("lowerRight", Shape::lower_right),
std::make_pair("upperRight", Shape::upper_right),
std::make_pair("straight", Shape::up),
}
@ up
Definition: traffic_light.hpp:149
@ upper_right
Definition: traffic_light.hpp:154
@ left
Definition: traffic_light.hpp:147
@ cross
Definition: traffic_light.hpp:146
@ lower_right
Definition: traffic_light.hpp:153
@ upper_left
Definition: traffic_light.hpp:152
@ lower_left
Definition: traffic_light.hpp:151
@ down
Definition: traffic_light.hpp:148
@ circle
Definition: traffic_light.hpp:145
@ right
Definition: traffic_light.hpp:150

◆ value

enum traffic_simulator::TrafficLight::Shape::Value traffic_simulator::TrafficLight::Shape::value

The documentation for this struct was generated from the following files: