50 lines
886 B
C++
50 lines
886 B
C++
/*
|
||
File: Room.cpp
|
||
* Description : Models a room entity that maintains room details and manages its bookings.
|
||
* Author : Trenser
|
||
* Created : 31-Mar-2026
|
||
*/
|
||
#include "Room.h"
|
||
|
||
int Room::m_uid = 0;
|
||
|
||
const std::string& Room::getRoomId() const
|
||
{
|
||
return m_id;
|
||
}
|
||
|
||
const std::string& Room::getRoomName() const
|
||
{
|
||
return m_name;
|
||
}
|
||
|
||
const bookingMap& Room::getBookings() const
|
||
{
|
||
return m_bookings;
|
||
}
|
||
|
||
void Room::setRoomId(const std::string& id)
|
||
{
|
||
m_id = id;
|
||
}
|
||
|
||
void Room::setRoomName(const std::string& name)
|
||
{
|
||
m_name = name;
|
||
}
|
||
|
||
/*
|
||
Function: addBooking
|
||
Description: Adds a valid booking to the room’s booking list using the booking ID as the key.
|
||
Parameters:
|
||
booking - A pointer to a Booking object to be added to the room.
|
||
Returns:
|
||
void
|
||
*/
|
||
void Room::addBooking(Booking* booking)
|
||
{
|
||
if (booking)
|
||
{
|
||
m_bookings[booking->getBookingId()] = booking;
|
||
}
|
||
} |