GroupList is a container for Spread group names. More...
#include <GroupList.h>
Classes |
|
| struct | group_type |
Public Member Functions |
|
| GroupList (const unsigned int capacity=10) | |
| Creates an empty GroupList with the specified initial capacity. |
|
| void | add (const string &group) |
| Appends a group name to the list. |
|
| void | add (const GroupList &groups) |
| Appends the contents another GroupList to this one. |
|
| string | group (const unsigned int index) const |
| Returns the group name at the specified index. |
|
| string | operator[] (const unsigned int index) const |
| Same as group(index). |
|
| GroupList & | operator= (const GroupList &groups) |
| Assigns the value of another GroupList to this one. |
|
| void | clear () |
| Empties the list. |
|
| unsigned int | size () const |
| Returns the number of groups in the list. |
|
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. |
|
| std::ostream & | operator<< (std::ostream &output, const GroupList &groups) |
| Outputs the group names contained in the list—one per line. |
|
Detailed Description
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 88 of file GroupList.h.
Constructor & Destructor Documentation
| GroupList::GroupList | ( | const unsigned int | capacity = 10 |
) | [inline, explicit] |
Creates an empty GroupList with the specified initial capacity.
Definition at line 120 of file GroupList.h.
Member Function Documentation
| void GroupList::add | ( | const string & | group | ) | [inline] |
Appends a group name to the list.
- Parameters:
-
group The group name to add.
Definition at line 127 of file GroupList.h.
References detail::Buffer< type >::add(), and size().
Referenced by Mailbox::add_group(), and Mailbox::add_groups().
| void GroupList::add | ( | const GroupList & | groups | ) | [inline] |
Appends the contents another GroupList to this one.
- Parameters:
-
groups The GroupList to append.
Definition at line 140 of file GroupList.h.
References size().
| void GroupList::clear | ( | ) | [inline] |
Empties the list.
Definition at line 182 of file GroupList.h.
References detail::Buffer< type >::clear().
Referenced by Mailbox::clear_groups().
| string GroupList::group | ( | const unsigned int | index | ) | const [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.
- Parameters:
-
index The index of the group name to return.
- Returns:
- The group name at the specified index.
Definition at line 157 of file GroupList.h.
Referenced by operator[]().
Assigns the value of another GroupList to this one.
- Parameters:
-
groups The GroupList to copy.
- Returns:
- *this
Definition at line 172 of file GroupList.h.
References size().
| string GroupList::operator[] | ( | const unsigned int | index | ) | const [inline] |
| unsigned int GroupList::size | ( | ) | const [inline] |
Returns the number of groups in the list.
- Returns:
- The number of groups in the list.
Definition at line 190 of file GroupList.h.
References detail::Buffer< type >::size().
Referenced by add(), Mailbox::count_groups(), and operator=().
Friends And Related Function Documentation
friend class BaseMessage [friend] |
Definition at line 196 of file GroupList.h.
friend class Mailbox [friend] |
Definition at line 195 of file GroupList.h.
| std::ostream& operator<< | ( | std::ostream & | output, |
| const GroupList & | groups | ||
| ) | [friend] |
Outputs the group names contained in the list—one per line.
- Parameters:
-
output The ostream to write to. groups The GroupList to output.
- Returns:
- The std::ostream output parameter.
Definition at line 232 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.
- Parameters:
-
groups1 The first GroupList in the comparison. groups2 The second GroupList in the comparison.
- Returns:
- true if the GroupLists contain the same groups in the same order, false if not.
Definition at line 208 of file GroupList.h.
The documentation for this class was generated from the following file: