Represents a list of users. More...
#include <Mediator_User_Classes.h>
Public Member Functions | |
StringList | UserNames () |
The user names contained in this list (read-only). The list is always sorted. | |
User * | FindUser (std::string name) |
Retrieve the User instance for the specified user name. The found user may be altered so it must point to the one in the list. | |
void | AddUser (std::string name) |
Add the specified user name as a user. Operation ignored if user is already in the list. | |
void | RemoveUser (std::string name) |
Remove the specified user name as a user. Operation ignored if user is not in the list. | |
Private Member Functions | |
std::vector< User >::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::vector< User > | _users |
The list of users. | |
Represents a list of users.
This is a simple implementation using a simple list. It is NOT thread-safe.
Definition at line 87 of file Mediator_User_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 100 of file Mediator_User_Classes.h.
References UserList::_users, and User::Equals().
Referenced by UserList::FindUser(), and UserList::RemoveUser().
|
inline |
Add the specified user name as a user. Operation ignored if user is already in the list.
name | Name of user to add. Cannot be null or empty. |
ArgumentNullException | The 'name' parameter is null or empty. |
Definition at line 152 of file Mediator_User_Classes.h.
References UserList::_users, and UserList::FindUser().
Referenced by UserGroupMediator::AddUser().
|
inline |
Retrieve the User instance for the specified user name. The found user may be altered so it must point to the one in the list.
name | User name to search for. |
Definition at line 133 of file Mediator_User_Classes.h.
References UserList::_SearchForUser(), and UserList::_users.
Referenced by UserList::AddUser(), UserGroupMediator::AddUserToGroup(), UserGroupMediator::GetGroupsWithUser(), UserGroupMediator::IsUserInGroup(), UserGroupMediator::RemoveUserFromAllGroups(), and UserGroupMediator::RemoveUserFromGroup().
|
inline |
Remove the specified user name as a user. Operation ignored if user is not in the list.
name | Name of user to remove. |
Definition at line 172 of file Mediator_User_Classes.h.
References UserList::_SearchForUser(), and UserList::_users.
Referenced by UserGroupMediator::RemoveUser().
|
inline |
The user names contained in this list (read-only). The list is always sorted.
Definition at line 115 of file Mediator_User_Classes.h.
References UserList::_users.
Referenced by UserGroupMediator::GetAllUsers().
|
private |
The list of users.
Definition at line 93 of file Mediator_User_Classes.h.
Referenced by UserList::_SearchForUser(), Group::AddUser(), UserList::AddUser(), Group::ContainsUser(), UserList::FindUser(), Group::RemoveUser(), UserList::RemoveUser(), UserList::UserNames(), and Group::Users().