sudo apt-get marks
 
Loading...
Searching...
No Matches
RoadSystemAdapter Class Reference

Adapter for integrating RoadSystem into a unified transport system. More...

#include <Transportation.h>

Inheritance diagram for RoadSystemAdapter:
UnifiedTransportSystem

Public Member Functions

 RoadSystemAdapter (RoadSystem *rs)
 Constructs a RoadSystemAdapter object.
 
 ~RoadSystemAdapter ()
 Destroys the RoadSystemAdapter object.
 
void addRoute (Road road)
 Adds a road to the road system.
 
vector< Road > & getRoads ()
 Gets the list of roads in the road system.
 
int getUtilization () override
 Gets the utilization of the road system.
 
void performMaintenance () override
 Performs maintenance on the road system.
 
- Public Member Functions inherited from UnifiedTransportSystem
virtual ~UnifiedTransportSystem ()
 Virtual destructor for proper cleanup of derived classes.
 

Detailed Description

Adapter for integrating RoadSystem into a unified transport system.

This class adapts the RoadSystem class to fit the UnifiedTransportSystem interface.

Constructor & Destructor Documentation

◆ RoadSystemAdapter()

RoadSystemAdapter::RoadSystemAdapter ( RoadSystem * rs)

Constructs a RoadSystemAdapter object.

Parameters
rsPointer to the RoadSystem to adapt.

Member Function Documentation

◆ addRoute()

void RoadSystemAdapter::addRoute ( Road road)

Adds a road to the road system.

Parameters
roadThe Road object to add.

◆ getRoads()

vector< Road > & RoadSystemAdapter::getRoads ( )

Gets the list of roads in the road system.

Returns
A reference to the vector of roads.

◆ getUtilization()

int RoadSystemAdapter::getUtilization ( )
overridevirtual

Gets the utilization of the road system.

Returns
The utilization percentage.

Implements UnifiedTransportSystem.

◆ performMaintenance()

void RoadSystemAdapter::performMaintenance ( )
overridevirtual

Performs maintenance on the road system.

Implements UnifiedTransportSystem.