xorp

ElemSetAny< T > Class Template Reference

A set of elements. More...

#include <elem_set.hh>

Inheritance diagram for ElemSetAny< T >:
ElemSet Element

List of all members.

Public Types

typedef set< T > Set
typedef Set::iterator iterator
typedef Set::const_iterator const_iterator

Public Member Functions

 ElemSetAny (const Set &val)
 ElemSetAny (const char *c_str)
string str () const
void insert (const T &s)
void insert (const ElemSetAny< T > &s)
 Insert all elements of other set.
bool operator== (const ElemSetAny< T > &rhs) const
 Left and right sets are identical [same elements and size].
bool operator!= (const ElemSetAny< T > &rhs) const
 Left and right are not identical.
bool operator< (const ElemSetAny< T > &rhs) const
 All elements on left match, but right has more elments.
bool operator> (const ElemSetAny< T > &rhs) const
 All elements on right match, but left has more elements.
bool operator<= (const ElemSetAny< T > &rhs) const
 Left is a subset of right.
bool operator>= (const ElemSetAny< T > &rhs) const
 Right is a subset of left.
bool operator< (const T &rhs) const
 All elements on left match, but right has more.
bool operator> (const T &rhs) const
 All elements on on right match, but left has more.
bool operator== (const T &rhs) const
 Left and right are identical.
bool operator!= (const T &rhs) const
 Disjoint sets.
bool operator<= (const T &rhs) const
 Left is a subset of right.
bool operator>= (const T &rhs) const
 Right is a subset of left.
bool nonempty_intersection (const ElemSetAny< T > &rhs) const
void erase (const ElemSetAny< T > &rhs)
 Removes elements in set.
void erase (const ElemSet &rhs)
iterator begin ()
 Obtain iterator for set.
iterator end ()
 Obtain an iterator for the end.
const_iterator begin () const
 Obtain const iterator for set.
const_iterator end () const
 Obtain an const iterator for the end.
const char * type () const

Static Public Attributes

static const char * id = "set_u32"
static Hash _hash = HASH_ELEM_SET_U32

Private Attributes

Set _val

Detailed Description

template<class T>
class ElemSetAny< T >

A set of elements.

All sets hold a string representation of the elements. All type information will be lost, as elements will all be promoted to strings.


Constructor & Destructor Documentation

template<class T >
ElemSetAny< T >::ElemSetAny ( const char *  c_str)
Parameters:
c_strinitialize from string in the form element1,element2,...

Member Function Documentation

template<class T >
ElemSetAny< T >::iterator ElemSetAny< T >::begin ( )

Obtain iterator for set.

Returns:
iterator for the set.
template<class T >
ElemSetAny< T >::const_iterator ElemSetAny< T >::begin ( ) const

Obtain const iterator for set.

Returns:
const iterator for the set.
template<class T >
ElemSetAny< T >::iterator ElemSetAny< T >::end ( )

Obtain an iterator for the end.

Returns:
iterator for the end of the set.
template<class T >
ElemSetAny< T >::const_iterator ElemSetAny< T >::end ( ) const

Obtain an const iterator for the end.

Returns:
const iterator for the end of the set.
template<class T>
void ElemSetAny< T >::erase ( const ElemSetAny< T > &  rhs)

Removes elements in set.

Parameters:
selements to remove.
template<class T>
void ElemSetAny< T >::insert ( const T &  s)
Parameters:
selement to insert.
template<class T>
void ElemSetAny< T >::insert ( const ElemSetAny< T > &  s)

Insert all elements of other set.

Parameters:
sset to insert.
template<class T>
bool ElemSetAny< T >::nonempty_intersection ( const ElemSetAny< T > &  rhs) const
Returns:
true if intersection is not empty
template<class T>
bool ElemSetAny< T >::operator!= ( const ElemSetAny< T > &  rhs) const

Left and right are not identical.

Parameters:
rhsset to compare with
template<class T>
bool ElemSetAny< T >::operator!= ( const T &  rhs) const

Disjoint sets.

Will be true if element is not contained in set.

Parameters:
rhselement to compare with.
template<class T>
bool ElemSetAny< T >::operator< ( const T &  rhs) const

All elements on left match, but right has more.

May only be true if left is an empty set.

Parameters:
rhselement to compare with.
template<class T>
bool ElemSetAny< T >::operator< ( const ElemSetAny< T > &  rhs) const

All elements on left match, but right has more elments.

Parameters:
rhsset to compare with
template<class T>
bool ElemSetAny< T >::operator<= ( const ElemSetAny< T > &  rhs) const

Left is a subset of right.

Parameters:
rhsset to compare with
template<class T>
bool ElemSetAny< T >::operator<= ( const T &  rhs) const

Left is a subset of right.

Will be true if set is empty or contains rhs.

Parameters:
rhselement to compare with.
template<class T>
bool ElemSetAny< T >::operator== ( const ElemSetAny< T > &  rhs) const

Left and right sets are identical [same elements and size].

Parameters:
rhsset to compare with
template<class T>
bool ElemSetAny< T >::operator== ( const T &  rhs) const

Left and right are identical.

Will be true in a single element set which contains the rhs element.

Parameters:
rhselement to compare with.
template<class T>
bool ElemSetAny< T >::operator> ( const T &  rhs) const

All elements on on right match, but left has more.

Will be true if the element is present in the set, and the set contains at least one more element.

Parameters:
rhselement to compare with.
template<class T>
bool ElemSetAny< T >::operator> ( const ElemSetAny< T > &  rhs) const

All elements on right match, but left has more elements.

Parameters:
rhsset to compare with
template<class T>
bool ElemSetAny< T >::operator>= ( const ElemSetAny< T > &  rhs) const

Right is a subset of left.

Parameters:
rhsset to compare with
template<class T>
bool ElemSetAny< T >::operator>= ( const T &  rhs) const

Right is a subset of left.

Will be true if element is contained in set.

Parameters:
rhselement to compare with.
template<class T >
string ElemSetAny< T >::str ( ) const [virtual]
Returns:
string representation of set.

Implements Element.

template<class T >
const char * ElemSetAny< T >::type ( ) const [virtual]
Returns:
string representation of element type.

Implements Element.


The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Enumerations