Represents a single group. A group has a name and zero or more users. Users are tracked by name. More...
#include <Mediator_Group_Classes.h>
Public Member Functions | |
Group () | |
Default constructor. | |
Group (std::string name) | |
Constructor. | |
std::string | Name () |
The name of the group (read-only). | |
StringList | Users () const |
The names of users in this group (read-only). | |
bool | ContainsUser (std::string name) |
Determine if the specified user is in this group. This is a case- sensitive search. | |
void | AddUser (std::string name) |
Add the specified user to this group. If the user is already in the group, the operation is ignored. | |
void | RemoveUser (std::string name) |
Remove a user from this group. If the user is not in the group then the operation is ignored. | |
bool | Equals (const Group &group) const |
Determine if the name of the specified group matches this Group's name. | |
bool | Equals (const std::string &name) const |
Determine if the given name matches this Group's name. | |
Private Member Functions | |
StringList::iterator | _SearchForUser (const std::string &name) |
Get an iterator pointing to the user with the specified name. Returns std::end(_users) if the user was not found with that name. | |
Private Attributes | |
std::string | _groupName |
Name of this group. | |
StringList | _users |
The list of users in this group. | |
Represents a single group. A group has a name and zero or more users. Users are tracked by name.
Definition at line 26 of file Mediator_Group_Classes.h.
|
inline |
Default constructor.
Definition at line 52 of file Mediator_Group_Classes.h.
|
inline |
Constructor.
name | Name of the group to use. |
Definition at line 59 of file Mediator_Group_Classes.h.
|
inlineprivate |
Get an iterator pointing to the user with the specified name. Returns std::end(_users) if the user was not found with that name.
Definition at line 43 of file Mediator_Group_Classes.h.
References Group::_users.
Referenced by UserList::FindUser(), and UserList::RemoveUser().
|
inline |
Add the specified user to this group. If the user is already in the group, the operation is ignored.
name | Name of the user to add. Cannot be null or empty. |
ArgumentNullException | The 'name' parameter must specify a user name. |
Definition at line 98 of file Mediator_Group_Classes.h.
References Group::_users, and Group::ContainsUser().
Referenced by UserGroupMediator::AddUserToGroup().
|
inline |
Determine if the specified user is in this group. This is a case- sensitive search.
name | Name of the user to look for. |
Definition at line 86 of file Mediator_Group_Classes.h.
References Group::_users.
Referenced by Group::AddUser(), UserGroupMediator::GetGroupsWithUser(), UserGroupMediator::IsUserInGroup(), Group::RemoveUser(), and UserGroupMediator::RemoveUserFromAllGroups().
|
inline |
Determine if the name of the specified group matches this Group's name.
group | A Group with which to compare names. |
Definition at line 133 of file Mediator_Group_Classes.h.
References Group::_groupName.
Referenced by GroupList::_SearchForGroup().
|
inline |
Determine if the given name matches this Group's name.
name | A string containing the name of the Group. |
Definition at line 143 of file Mediator_Group_Classes.h.
References Group::_groupName.
|
inline |
The name of the group (read-only).
Definition at line 67 of file Mediator_Group_Classes.h.
References Group::_groupName.
Referenced by Visitor_Shop::PickupOrder(), Visitor_Shop::PlaceOrder(), and EntryInformation::ToString().
|
inline |
Remove a user from this group. If the user is not in the group then the operation is ignored.
name | The name of the user to remove. |
Definition at line 118 of file Mediator_Group_Classes.h.
References Group::_users.
Referenced by UserGroupMediator::RemoveUserFromAllGroups(), and UserGroupMediator::RemoveUserFromGroup().
|
inline |
The names of users in this group (read-only).
Definition at line 75 of file Mediator_Group_Classes.h.
References Group::_users.
Referenced by UserGroupMediator::GetUsersInGroup().
|
private |
Name of this group.
Definition at line 32 of file Mediator_Group_Classes.h.
Referenced by Group::__eq__(), Group::Equals(), and Group::Name().
|
private |
The list of users in this group.
Definition at line 37 of file Mediator_Group_Classes.h.
Referenced by Group::_SearchForUser(), UserList::_SearchForUser(), UserList::AddUser(), Group::AddUser(), Group::ContainsUser(), UserList::FindUser(), UserList::RemoveUser(), Group::RemoveUser(), UserList::UserNames(), and Group::Users().