Conference Registration 2024.07.18.04
|
Manages a list of conference registrations. More...
#include <registrationlist.h>
Signals | |
void | registrationAdded (Registration *registration) |
Signal emitted when a registration is added to the list. | |
void | registrationRemoved (Registration *registration) |
Signal emitted when a registration is removed from the list. | |
Public Member Functions | |
RegistrationList (RegistrationModel &model, QObject *parent=nullptr) | |
Constructs a RegistrationList. | |
~RegistrationList () | |
Destructor for RegistrationList. Cleans up the list of Registrations. | |
bool | addRegistration (Registration *registration) |
Adds a registration to the list if the attendee's name is not already on the list. | |
bool | removeRegistration (Registration *registration) |
Removes the selected registration from the list. | |
bool | isRegistered (const QString &name) const |
Checks if an attendee with the given name is already registered. | |
bool | isRegistered (const Person &person) const |
Checks if an attendee is already registered. | |
double | totalFee (const QString &typeString) const |
Calculates the total registration fees for a given type of registration. | |
int | totalRegistrations (const QString &affiliation) const |
Returns the number of attendees registered for the conference from a specific institution. | |
QList< Registration * > | getAttendeeList () const |
Returns the list of attendees. | |
Manages a list of conference registrations.
The RegistrationList class provides functionality to add and query conference registrations. It ensures no duplicate email addresses exist, unless they are associated with different names. It also calculates total fees based on registration types, as well as the number of attendees registered from a specific institution/affiliation.
RegistrationList::RegistrationList | ( | RegistrationModel & | model, |
QObject * | parent = nullptr ) |
Constructs a RegistrationList.
model | The RegistrationModel object. |
parent | The parent QObject, default is nullptr. |
bool RegistrationList::addRegistration | ( | Registration * | registration | ) |
Adds a registration to the list if the attendee's name is not already on the list.
registration | The registration to be added. |
QList< Registration * > RegistrationList::getAttendeeList | ( | ) | const |
Returns the list of attendees.
bool RegistrationList::isRegistered | ( | const Person & | person | ) | const |
Checks if an attendee is already registered.
person | The Person object representing the attendee. |
bool RegistrationList::isRegistered | ( | const QString & | name | ) | const |
Checks if an attendee with the given name is already registered.
name | The name of the attendee. |
|
signal |
Signal emitted when a registration is added to the list.
registration | The added registration. |
|
signal |
Signal emitted when a registration is removed from the list.
registration | The removed registration. |
bool RegistrationList::removeRegistration | ( | Registration * | registration | ) |
Removes the selected registration from the list.
registration | The registration to be removed. |
double RegistrationList::totalFee | ( | const QString & | typeString | ) | const |
Calculates the total registration fees for a given type of registration.
typeString | The type of registration. |
int RegistrationList::totalRegistrations | ( | const QString & | affiliation | ) | const |
Returns the number of attendees registered for the conference from a specific institution.
affiliation | The affiliation (institution). |