Savarese Software Research Corporation
GroupList Class Reference

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...
 

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 90 of file GroupList.h.

Constructor & Destructor Documentation

GroupList::GroupList ( const unsigned int  capacity = 10 )
inlineexplicit

Creates an empty GroupList with the specified initial capacity.

Definition at line 122 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 129 of file GroupList.h.

References group_type, 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 142 of file GroupList.h.

References group_type, resize(), and size().

void GroupList::clear ( )
inline

Empties the list.

Definition at line 184 of file GroupList.h.

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 159 of file GroupList.h.

Referenced by operator[]().

GroupList& GroupList::operator= ( const GroupList groups )
inline

Assigns the value of another GroupList to this one.

Parameters
groups The GroupList to copy.
Returns
*this

Definition at line 174 of file GroupList.h.

References group_type, resize(), and size().

string GroupList::operator[] ( const unsigned int  index ) const
inline

Same as group(index).

Definition at line 164 of file GroupList.h.

References group().

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 192 of file GroupList.h.

Referenced by add(), Mailbox::count_groups(), and operator=().

Friends And Related Function Documentation

friend class BaseMessage
friend

Definition at line 198 of file GroupList.h.

friend class Mailbox
friend

Definition at line 197 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 234 of file GroupList.h.

bool operator== ( const GroupList groups1,
const GroupList groups2 
)
friend

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 210 of file GroupList.h.


The documentation for this class was generated from the following file:

Savarese Software Research Corporation
Copyright © 2006-2015 Savarese Software Research Corporation. All rights reserved.