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::Color Struct Reference

#include <traffic_light.hpp>

Public Types

enum  Value : std::uint8_t { green , yellow , red , white }
 

Public Member Functions

constexpr Color (const Value value=green)
 
 Color (const std::string &name)
 
constexpr auto is (const Color given) const
 
constexpr operator Value () const noexcept
 

Static Public Member Functions

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

Public Attributes

enum traffic_simulator::TrafficLight::Color::Value value
 

Static Public Attributes

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

Friends

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

Member Enumeration Documentation

◆ Value

Enumerator
green 
yellow 
red 
white 

Constructor & Destructor Documentation

◆ Color() [1/2]

constexpr traffic_simulator::TrafficLight::Color::Color ( const Value  value = green)
inlineconstexpr

◆ Color() [2/2]

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

Member Function Documentation

◆ is()

constexpr auto traffic_simulator::TrafficLight::Color::is ( const Color  given) const
inlineconstexpr

◆ make()

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

◆ operator Value()

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

Friends And Related Function Documentation

◆ operator<<

auto operator<< ( std::ostream &  os,
const Color color 
) -> std::ostream &
friend

◆ operator>>

auto operator>> ( std::istream &  is,
TrafficLight::Color color 
) -> std::istream &
friend

Member Data Documentation

◆ table

const std::unordered_map<std::string, Value> traffic_simulator::TrafficLight::Color::table
inlinestatic
Initial value:
{
std::make_pair("amber", yellow),
std::make_pair("green", green),
std::make_pair("red", red),
std::make_pair("white", white),
std::make_pair("yellow", yellow),
std::make_pair("Green", green),
std::make_pair("Red", red),
std::make_pair("Yellow", yellow),
}
@ white
Definition: traffic_light.hpp:47
@ green
Definition: traffic_light.hpp:44
@ red
Definition: traffic_light.hpp:46
@ yellow
Definition: traffic_light.hpp:45

◆ value

enum traffic_simulator::TrafficLight::Color::Value traffic_simulator::TrafficLight::Color::value

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