Represents a list of Groups. More...
#include <Mediator_Group_Classes.h>
Public Member Functions | |
StringList | GroupNames () |
The names of all groups contained in this list (read-only). The list is always sorted. | |
Group * | FindGroup (std::string name) |
Retrieve the Group instance for the specified group name. The found group may be altered so it must point to the one in the list. | |
void | AddGroup (std::string name) |
Add a group to the list using the given group name. Operation ignored if the group is already in the list. | |
void | RemoveGroup (std::string name) |
Remove the specified group from the list. Operation ignored if the group is not in the list. | |
Private Member Functions | |
std::vector< Group >::iterator | _SearchForGroup (const std::string &name) |
Get an iterator pointing to the group with the specified name. Returns std::end(_groups) if the group was not found with that name. | |
Private Attributes | |
std::vector< Group > | _groups |
The list of groups. | |
Represents a list of Groups.
This is a simple implementation using a simple list. It is NOT thread-safe.
Definition at line 159 of file Mediator_Group_Classes.h.
|
inlineprivate |
Get an iterator pointing to the group with the specified name. Returns std::end(_groups) if the group was not found with that name.
Definition at line 172 of file Mediator_Group_Classes.h.
References GroupList::_groups, and Group::Equals().
Referenced by GroupList::FindGroup(), and GroupList::RemoveGroup().
|
inline |
Add a group to the list using the given group name. Operation ignored if the group is already in the list.
name | Name of the group to add. Cannot be null or empty. |
ArgumentNullException | The group name cannot be null or empty. |
Definition at line 229 of file Mediator_Group_Classes.h.
References GroupList::_groups, and GroupList::FindGroup().
Referenced by UserGroupMediator::AddGroup().
|
inline |
Retrieve the Group instance for the specified group name. The found group may be altered so it must point to the one in the list.
name | Group name to search for. |
<returns">Returns pointer to a Group object if name found. Returns null if not found.
Definition at line 211 of file Mediator_Group_Classes.h.
References GroupList::_groups, and GroupList::_SearchForGroup().
Referenced by GroupList::AddGroup(), UserGroupMediator::AddUserToGroup(), UserGroupMediator::GetGroupsWithUser(), UserGroupMediator::GetUsersInGroup(), UserGroupMediator::IsUserInGroup(), UserGroupMediator::RemoveUserFromAllGroups(), and UserGroupMediator::RemoveUserFromGroup().
|
inline |
The names of all groups contained in this list (read-only). The list is always sorted.
Definition at line 187 of file Mediator_Group_Classes.h.
References GroupList::_groups, and Helpers::stricmp().
Referenced by UserGroupMediator::GetAllGroups(), UserGroupMediator::GetGroupsWithUser(), and UserGroupMediator::RemoveUserFromAllGroups().
|
inline |
Remove the specified group from the list. Operation ignored if the group is not in the list.
name | Name of the group to remove. |
Definition at line 248 of file Mediator_Group_Classes.h.
References GroupList::_groups, and GroupList::_SearchForGroup().
Referenced by UserGroupMediator::RemoveGroup().
|
private |
The list of groups.
Definition at line 165 of file Mediator_Group_Classes.h.
Referenced by GroupList::_SearchForGroup(), GroupList::AddGroup(), GroupList::FindGroup(), GroupList::GroupNames(), and GroupList::RemoveGroup().