47 lines
No EOL
1.3 KiB
C#
47 lines
No EOL
1.3 KiB
C#
namespace WaitingRoom;
|
|
|
|
/// <summary>
|
|
/// A queue implementation which can be used to represents the waiting queue of
|
|
/// patients at a doctor's office.
|
|
/// </summary>
|
|
public sealed class PatientQueue
|
|
{
|
|
//private Node? _head;
|
|
|
|
/// <summary>
|
|
/// Gets the number of patients currently waiting in this queue
|
|
/// </summary>
|
|
public int Size { get; private set; }
|
|
|
|
/// <summary>
|
|
/// Adds a new patient to the queue.
|
|
/// Patients are ordered by arrival time.
|
|
/// </summary>
|
|
/// <param name="patient">Patient to add to the queue</param>
|
|
public void Enqueue(Patient patient)
|
|
{
|
|
// TODO
|
|
}
|
|
|
|
/// <summary>
|
|
/// Removes the next patient from the queue.
|
|
/// </summary>
|
|
/// <returns>The next patient to be treated; null if no patient is waiting</returns>
|
|
public Patient? Dequeue()
|
|
{
|
|
// TODO
|
|
return null;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Removes the supplied patient from the queue.
|
|
/// Only patients actually waiting in this queue can be removed.
|
|
/// </summary>
|
|
/// <param name="patient">The patient to remove from the queue</param>
|
|
/// <returns>True if the patient could be removed; false otherwise</returns>
|
|
public bool Remove(Patient patient)
|
|
{
|
|
// TODO
|
|
return false;
|
|
}
|
|
} |