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

#include <traffic_light.hpp>

Public Types

enum  Value : std::uint8_t { solid_on , solid_off , flashing , unknown }
 

Public Member Functions

constexpr Status (const Value value=solid_on)
 
 Status (const std::string &name)
 
constexpr auto is (const Value given) const
 
constexpr operator bool () const
 
constexpr operator Value () const noexcept
 

Static Public Member Functions

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

Public Attributes

enum traffic_simulator::TrafficLight::Status::Value value
 

Static Public Attributes

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

Friends

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

Member Enumeration Documentation

◆ Value

enum traffic_simulator::TrafficLight::Status::Value : std::uint8_t
Enumerator
solid_on 
solid_off 
flashing 
unknown 

Constructor & Destructor Documentation

◆ Status() [1/2]

constexpr traffic_simulator::TrafficLight::Status::Status ( const Value  value = solid_on)
inlineconstexpr

◆ Status() [2/2]

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

Member Function Documentation

◆ is()

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

◆ make()

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

◆ operator bool()

constexpr traffic_simulator::TrafficLight::Status::operator bool ( ) const
inlineconstexpr

◆ operator Value()

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

Friends And Related Function Documentation

◆ operator<<

auto operator<< ( std::ostream &  os,
const Status status 
) -> std::ostream &
friend

◆ operator>>

auto operator>> ( std::istream &  is,
TrafficLight::Status status 
) -> std::istream &
friend

Member Data Documentation

◆ table

const std::unordered_map<std::string, Value> traffic_simulator::TrafficLight::Status::table
inlinestatic
Initial value:
{
std::make_pair("solidOn", solid_on),
std::make_pair("solidOff", solid_off),
std::make_pair("flashing", flashing),
std::make_pair("unknown", unknown),
std::make_pair("Blank", solid_off),
std::make_pair("none", solid_off),
}
@ solid_off
Definition: traffic_light.hpp:91
@ unknown
Definition: traffic_light.hpp:93
@ solid_on
Definition: traffic_light.hpp:90
@ flashing
Definition: traffic_light.hpp:92

◆ value

enum traffic_simulator::TrafficLight::Status::Value traffic_simulator::TrafficLight::Status::value

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