Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

Tagcoll::OpSet< T > Class Template Reference

OpSet is the standard std::set extended with set operations. More...

#include <OpSet.h>

List of all members.

Public Member Functions

bool contains (const T &item) const throw ()
bool contains (const OpSet< T > &ts) const throw ()
int distance (const OpSet< T > &ts) const throw ()
OpSet< T > operator+ (const T &tag) const throw ()
 Singleton union.
OpSet< T > & operator+= (const T &ts) throw ()
 Singleton union.
OpSet< T > operator+ (const OpSet< T > &ts) const throw ()
 Set union.
OpSet< T > & operator+= (const OpSet< T > &ts) throw ()
 Singleton union.
OpSet< T > operator- (const T &tag) const throw ()
 Singleton difference.
OpSet< T > & operator-= (const T &tag) throw ()
 Singleton difference.
OpSet< T > operator- (const OpSet< T > &ts) const throw ()
 Set difference.
OpSet< T > & operator-= (const OpSet< T > &ts) throw ()
 Set difference.
OpSet< T > operator^ (const OpSet< T > &ts) const throw ()
 Set intersection.
OpSet< T > & operator^= (const OpSet< T > &ts) throw ()
 Set intersection.


Detailed Description

template<class T>
class Tagcoll::OpSet< T >

OpSet is the standard std::set extended with set operations.

Example:

  OpSet<string> myfavs;
  OpSet<string> yourfavs;
  myfavourite += "pear";
  myfavourite += "banana";
  yourfavourite += "apple";
  yourfavourite += "pear";
  OpSet<string> ourfavs = myfavs ^ yourfavs;
  OpSet<string> interesting = myfavs + yourfavs;
  OpSet<string> myonlyfavs = myfavs - yourfavs;
  for (OpSet<string>::const_iterator i = ourfavs.begin();
       i != ourfavs.end(); i++)
     cout << *i << endl;


Member Function Documentation

template<class T>
bool OpSet::contains const OpSet< T > &  ts  )  const throw ()
 

template<class T>
bool Tagcoll::OpSet< T >::contains const T &  item  )  const throw () [inline]
 

template<class T>
int OpSet::distance const OpSet< T > &  ts  )  const throw ()
 

template<class T>
OpSet< T > OpSet::operator+ const OpSet< T > &  ts  )  const throw ()
 

Set union.

Returns:
the set union of this set and the set ts

template<class T>
OpSet< T > OpSet::operator+ const T &  tag  )  const throw ()
 

Singleton union.

Returns:
the set union of this set and the singleton set {tag}

template<class T>
OpSet< T > & OpSet::operator+= const OpSet< T > &  ts  )  throw ()
 

Singleton union.

Returns:
the set union of this set and the singleton set {tag}

template<class T>
OpSet< T > & OpSet::operator+= const T &  ts  )  throw ()
 

Singleton union.

Returns:
the set union of this set and the singleton set {tag}

template<class T>
OpSet< T > OpSet::operator- const OpSet< T > &  ts  )  const throw ()
 

Set difference.

Returns:
the set difference of this set and the set ts

template<class T>
OpSet< T > OpSet::operator- const T &  tag  )  const throw ()
 

Singleton difference.

Returns:
the set difference of this set and the singleton set {tag}

template<class T>
OpSet< T > & OpSet::operator-= const OpSet< T > &  ts  )  throw ()
 

Set difference.

Returns:
the set difference of this set and the set ts

template<class T>
OpSet< T > & OpSet::operator-= const T &  tag  )  throw ()
 

Singleton difference.

Returns:
the set difference of this set and the singleton set {tag}

template<class T>
OpSet< T > OpSet::operator^ const OpSet< T > &  ts  )  const throw ()
 

Set intersection.

Returns:
the set intersection of this set and the set ts

template<class T>
OpSet< T > & OpSet::operator^= const OpSet< T > &  ts  )  throw ()
 

Set intersection.

Returns:
the set intersection of this set and the set ts


The documentation for this class was generated from the following files:
Generated on Sun Aug 15 12:36:49 2004 for libtagcoll by doxygen 1.3.8