Interface for ticket service.
More...
#include <ITicketService.h>
|
| virtual | ~ITicketService ()=default |
| |
| virtual uint32_t | getNewTicket ()=0 |
| | Create new ticket.
|
| |
| virtual bool | payTicket (uint32_t ticketId)=0 |
| | Mark ticket as paid.
|
| |
| virtual bool | validateAndUseTicket (uint32_t ticketId)=0 |
| | Validate ticket is paid and mark as used (for exit)
|
| |
| virtual bool | getTicketInfo (uint32_t ticketId, Ticket &ticket) const =0 |
| | Get ticket information.
|
| |
| virtual uint32_t | getActiveTicketCount () const =0 |
| | Get number of active (not used) tickets.
|
| |
| virtual uint32_t | getCapacity () const =0 |
| | Get maximum parking capacity.
|
| |
| virtual void | reset ()=0 |
| | Reset ticket service to initial state Clears all tickets and resets ID counter to 1.
|
| |
| virtual void | setCapacity (uint32_t capacity)=0 |
| | Set parking capacity.
|
| |
Interface for ticket service.
Manages parking tickets throughout the vehicle lifecycle:
- Entry: Issue new ticket
- Payment: Mark ticket as paid
- Exit: Validate and use ticket
◆ ~ITicketService()
| virtual ITicketService::~ITicketService |
( |
| ) |
|
|
virtualdefault |
◆ getActiveTicketCount()
| virtual uint32_t ITicketService::getActiveTicketCount |
( |
| ) |
const |
|
pure virtual |
Get number of active (not used) tickets.
- Returns
- Number of cars currently in parking garage
Implemented in TicketService.
◆ getCapacity()
| virtual uint32_t ITicketService::getCapacity |
( |
| ) |
const |
|
pure virtual |
Get maximum parking capacity.
- Returns
- Maximum number of parking spaces
Implemented in TicketService.
◆ getNewTicket()
| virtual uint32_t ITicketService::getNewTicket |
( |
| ) |
|
|
pure virtual |
◆ getTicketInfo()
| virtual bool ITicketService::getTicketInfo |
( |
uint32_t |
ticketId, |
|
|
Ticket & |
ticket |
|
) |
| const |
|
pure virtual |
Get ticket information.
- Parameters
-
| ticketId | Ticket ID |
| ticket | Output ticket structure |
- Returns
- true if ticket exists, false otherwise
Implemented in TicketService.
◆ payTicket()
| virtual bool ITicketService::payTicket |
( |
uint32_t |
ticketId | ) |
|
|
pure virtual |
Mark ticket as paid.
- Parameters
-
- Returns
- true if successful, false if ticket doesn't exist
Implemented in TicketService.
◆ reset()
| virtual void ITicketService::reset |
( |
| ) |
|
|
pure virtual |
Reset ticket service to initial state Clears all tickets and resets ID counter to 1.
Implemented in TicketService.
◆ setCapacity()
| virtual void ITicketService::setCapacity |
( |
uint32_t |
capacity | ) |
|
|
pure virtual |
Set parking capacity.
- Parameters
-
| capacity | New maximum parking capacity |
Implemented in TicketService.
◆ validateAndUseTicket()
| virtual bool ITicketService::validateAndUseTicket |
( |
uint32_t |
ticketId | ) |
|
|
pure virtual |
Validate ticket is paid and mark as used (for exit)
- Parameters
-
- Returns
- true if paid and not already used, false otherwise
Implemented in TicketService.
The documentation for this class was generated from the following file: