CrossGuard
Loading...
Searching...
No Matches
Public Member Functions | List of all members
CarsTrafficLightSystem Class Reference

Implements traffic light control specifically for cars. More...

#include <CarsTrafficLightSystem.h>

Inheritance diagram for CarsTrafficLightSystem:
TrafficLight

Public Member Functions

 CarsTrafficLightSystem ()
 Constructs a new Cars Traffic Light System object.
 
void initialize ()
 Initializes the traffic light system.
 
void run ()
 Runs the main logic of the traffic light control.
 
void deactivate ()
 Deactivates the traffic light system.
 
- Public Member Functions inherited from TrafficLight
 TrafficLight (int redPin, int greenPin)
 Constructor for a traffic light with specified pins for the red and green LEDs.
 
 TrafficLight (int redPin, int greenPin, int yellowPin)
 Constructor for a traffic light with specified pins for the red, green, and yellow LEDs.
 
void turnRed ()
 Sets the traffic light to red.
 
void turnGreen ()
 Sets the traffic light to green.
 
void turnYellow ()
 Sets the traffic light to yellow.
 
void turnOff ()
 Turns off all lights.
 

Additional Inherited Members

- Public Types inherited from TrafficLight
enum class  State { OFF , RED , GREEN , YELLOW }
 Represents the possible states of a traffic light. More...
 

Detailed Description

Implements traffic light control specifically for cars.

Inherits from TrafficLight and provides methods to initialize, activate, run, and deactivate the traffic light system. This class uses atomic variables to manage state in a thread-safe manner.

Constructor & Destructor Documentation

◆ CarsTrafficLightSystem()

CarsTrafficLightSystem::CarsTrafficLightSystem ( )

Constructs a new Cars Traffic Light System object.

Initializes the traffic light system with specific pins for red, green, and yellow lights.

Member Function Documentation

◆ deactivate()

void CarsTrafficLightSystem::deactivate ( )

Deactivates the traffic light system.

Turns off all lights and marks the system as inactive.

◆ initialize()

void CarsTrafficLightSystem::initialize ( )

Initializes the traffic light system.

Placeholder for initialization code, if any additional setup is required.

◆ run()

void CarsTrafficLightSystem::run ( )

Runs the main logic of the traffic light control.

Placeholder for the main operational logic of the traffic light system.


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