GroupList is a container for Spread group names. More...
#include <GroupList.h>
Public Member Functions |
|
GroupList (const unsigned int capacity=10) | |
Creates an empty GroupList with the specified initial capacity. More... |
|
void | add (const string &group) |
Appends a group name to the list. More... |
|
void | add (const GroupList &groups) |
Appends the contents another GroupList to this one. More... |
|
string | group (const unsigned int index) const |
Returns the group name at the specified index. More... |
|
string | operator[] (const unsigned int index) const |
Same as group(index). More... |
|
GroupList & | operator= (const GroupList &groups) |
Assigns the value of another GroupList to this one. More... |
|
void | clear () |
Empties the list. More... |
|
unsigned int | size () const |
Returns the number of groups in the list. More... |
|
Friends |
|
class | Mailbox |
class | BaseMessage |
bool | operator== (const GroupList &groups1, const GroupList &groups2) |
Tests that two GroupLists contain the exact same number of groups with the exact same values in the exact same order. More... |
|
std::ostream & | operator<< (std::ostream &output, const GroupList &groups) |
Outputs the group names contained in the list—one per line. More... |
|
GroupList is a container for Spread group names.
You use it to determine the destination of a message or ascertain membership information. A GroupList can be resized by its friend classes as needed so that you don't have to pre-allocate a very large list or handle short buffer errors.
Definition at line 90 of file GroupList.h.
|
inlineexplicit |
Creates an empty GroupList with the specified initial capacity.
Definition at line 122 of file GroupList.h.
|
inline |
Appends a group name to the list.
group | The group name to add. |
Definition at line 129 of file GroupList.h.
References group_type, and size().
Referenced by Mailbox::add_group(), and Mailbox::add_groups().
|
inline |
Appends the contents another GroupList to this one.
groups | The GroupList to append. |
Definition at line 142 of file GroupList.h.
References group_type, resize(), and size().
|
inline |
Empties the list.
Definition at line 184 of file GroupList.h.
Referenced by Mailbox::clear_groups().
|
inline |
Returns the group name at the specified index.
No bounds checking is performed; it is the responsibility of the caller to ensure a valid index is provided.
index | The index of the group name to return. |
Definition at line 159 of file GroupList.h.
Referenced by operator[]().
Assigns the value of another GroupList to this one.
groups | The GroupList to copy. |
Definition at line 174 of file GroupList.h.
References group_type, resize(), and size().
|
inline |
|
inline |
Returns the number of groups in the list.
Definition at line 192 of file GroupList.h.
Referenced by add(), Mailbox::count_groups(), and operator=().
|
friend |
Definition at line 198 of file GroupList.h.
|
friend |
Definition at line 197 of file GroupList.h.
|
friend |
Outputs the group names contained in the list—one per line.
output | The ostream to write to. |
groups | The GroupList to output. |
Definition at line 234 of file GroupList.h.
Tests that two GroupLists contain the exact same number of groups with the exact same values in the exact same order.
Use namespace std::rel_ops to gain the != operator.
groups1 | The first GroupList in the comparison. |
groups2 | The second GroupList in the comparison. |
Definition at line 210 of file GroupList.h.