My Project
Public Member Functions | List of all members
Passenger Class Reference

The main class to define passenger. More...

#include <passenger.h>

Collaboration diagram for Passenger:
Collaboration graph

Public Member Functions

 Passenger (int=-1, std::string="Nobody")
 Constructs a passenger with a standard name and id. More...
 
void Update ()
 Method to update wait at stop.
 
void GetOnBus ()
 Passenger getting on bus.
 
int GetTotalWait () const
 Total wait time on stop and on bus.
 
bool IsOnBus () const
 Method to decide if a passenger is on bus. More...
 
int GetDestination () const
 Get destination id of the passenger. More...
 
void Report (std::ostream &out) const
 Public reporter.
 

Detailed Description

The main class to define passenger.

Constructor & Destructor Documentation

◆ Passenger()

Passenger::Passenger ( int  destination_stop_id = -1,
std::string  name = "Nobody" 
)
explicit

Constructs a passenger with a standard name and id.

Parameters
[in]intholding an id number
[in]stringholding a name of a created passenger.

Member Function Documentation

◆ GetDestination()

int Passenger::GetDestination ( ) const

Get destination id of the passenger.

Returns
integer

◆ IsOnBus()

bool Passenger::IsOnBus ( ) const

Method to decide if a passenger is on bus.

This function shows status of whether a passenger is on bus.

Returns
a Boolean value

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