Class: TSetOf

Declaration: SetOf.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

TCollectionOf

Inherited By:

None.

Purpose:

TSetOf is a template class that you can use to create unordered collections of objects. Operators are provided for modifying a TSetOf object base on the contents of another TSetOf object. TSetOf also inherits operators for adding, removing, querying, counting and iterating the objects it contains.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

You should not derive any classes from TSetOf.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Other Considerations:

None.

Member Function: TSetOf::TSetOf

  1. TSetOf ()
  2. 2 TSetOf (const TSetOf < AType > & s)
  3. TSetOf (TComparator < AType > * adoptedComparator, TStreamer < AType > * adoptedStreamer, CollectionCount setSizeHint =kCollectionSizeHint)

Interface Category:

API.

Purpose:

  1. Default constructor.
  2. Copy constructor.
  3. Creates a TSetOf with the comparator and streamer intialized to the specified objects.

Calling Context:

  1. Call this function directly anywhere the creation of a TSetOf is desired.
  2. Call this function directly to copy an object.
  3. Call this function directly to create an object with the specified comparator and streamer objects.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSetOf::~TSetOf

virtual ~ TSetOf ()

Interface Category:

API.

Purpose:

Destructor.

Calling Context:

Call this function directly to destroy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSetOf::operator=

const TSetOf < AType > & operator =(const TSetOf < AType > &)

Interface Category:

API.

Purpose:

Assignment operator.

Calling Context:

Call this function directly when an object is assigned to another compatible object.

Parameters:

Return Value:

A reference to the left-hand side object.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSetOf::Difference

  1. void Difference (const TSetOf < AType > & set1)
  2. void Difference (const TSetOf < AType > & set1, TSetOf < AType > & resulTSetOf) const

Interface Category:

API.

Purpose:

  1. Compares this set to set1 then modifies this set to contain only those objects that do not appear in set1.
  2. Compares this set to set1. Then modifies resultSet to contain only those objects that appear in this set but do not appear in set1.

Calling Context:

  1. Call this function directly to modify this set or that it contains only those objects that do not appear in the other set.
  2. Call this function directly to modify resultSet so that it contains only those objects that appear in this set and not in set1.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSetOf::Intersection

  1. void Intersection (const TSetOf < AType > & set1)
  2. void Intersection (const TSetOf < AType > & set1, TSetOf < AType > & resulTSetOf) const

Interface Category:

API.

Purpose:

  1. Compares this set to set1 then modifies this set to contain only those objects that appear in this set and set1.
  2. Compares this set to set1. Then modifies resultSet to contain only those objects that appear in this set and in set1.

Calling Context:

  1. Call this function directly to modify this set or that it contains the intersection of this set and set1.
  2. Call this function directly to modify resultSet so that it contains the intersection of this set and set1.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSetOf::Union

  1. void Union (const TSetOf < AType > & set1)
  2. void Union (const TSetOf < AType > & set1, TSetOf < AType > & resulTSetOf) const

Interface Category:

API.

Purpose:

  1. Compares this set to set1 then modifies this set to contain those objects that appear in both this set and set1.
  2. Compares this set to set1. Then modifies resultSet to contain those objects that appear in both this set and in set1.

Calling Context:

  1. Call this function directly to modify this set so that it contains the union of this set and set1.
  2. Call this function directly to modify resultSet so that it contains the union of this set and set1.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSetOf::Xor

  1. void Xor (const TSetOf < AType > & set1)
  2. void Xor (const TSetOf < AType > & set1, TSetOf < AType > & resulTSetOf) const

Interface Category:

API.

Purpose:

  1. Compares this set to set1 then modifies this set to contain those objects that appear in this set or set1, but not both.
  2. Compares this set to set1. Then modifies resultSet to contain those objects that appear in this set or set1, but not both.

Calling Context:

  1. Call this function directly to modify this set so that it contains the exclusive OR of this set and set1.
  2. Call this function directly to modify resultSet so that it contains the exclusive OR of this set and set1.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSetOf::Rehash

void Rehash ()

Interface Category:

API.

Purpose:

Rehashes this set.

Calling Context:

Call this function directly to rehash this set.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSetOf::operator==

bool operator ==(const TSetOf < AType > & setOf) const

Interface Category:

API.

Purpose:

Tests whether this set is equivalent to another set.

Calling Context:

Call this function directly to test the equivalence of the two objects on either side of the == symbol.

Parameters:

Return Value:

Returns true if this set is equivalent to the other set.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSetOf::operator!=

bool operator != (const TSetOf < AType > & setOf) const

Interface Category:

API.

Purpose:

Tests whether this set is equivalent to another set.

Calling Context:

Call this function directly to test the equivalence of the two objects on either side of the != symbol.

Parameters:

Return Value:

Returns true if this set is not equivalent to the other set.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.