Class: TDequeOf

Declaration: DequeOf.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

TSequenceOf

Inherited By:

None.

Purpose:

TDequeOf in a class you can use to implement a collection of elements that may be managed as a linked list, a stack or a queue. The collection automatically grows in size, as needed, when objects are added.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

Do not derive any classes from TDequeOf.

Concurrency:

Not multithread safe.

Resource Use:

The amount of memory used by objects of this class depends on the initial size of the collection, the number of objects it contains and how much you attempt to increase the collection's size.

Other Considerations:

None.

Member Function: TDequeOf::TDequeOf

  1. TDequeOf ()
  2. TDequeOf (const TDequeOf < AType > &)
  3. TDequeOf (TComparator < AType > * adoptedComparator, TStreamer < AType > * adoptedStreamer)

Interface Category:

API.

Purpose:

  1. Default constructor.
  2. Copy constructor.
  3. Creates an empty TDequeOf with adoptedComparator and adoptedStreamer initialized to the specified parameters.

Calling Context:

  1. Call this function directly anywhere the creation of a TDequeOf is desired.
  2. Call this function directly to copy an object.
  3. Call this function directly to create an empty TDequeOf with adoptedComparator and adoptedStreamer initialized to the specified parameters.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TDequeOf::~TDequeOf

virtual ~ TDequeOf ()

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: TDequeOf::operator=

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

Interface Category:

API.

Purpose:

Assignment operator.

Calling Context:

Call this function directly when an object is assigned to another 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: TDequeOf::AddAfter

void AddAfter (const AType & existingobj, AType * tobeadded)

Interface Category:

API.

Purpose:

Adds an object to the collection.

Calling Context:

Call this function directly to add an object after a specified object in the collection.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TDequeOf::AddBefore

void AddBefore (const AType & existingobj, AType * tobeadded)

Interface Category:

API.

Purpose:

Adds an object to the collection.

Calling Context:

Call this function directly to add an object before a specified object in the collection.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TDequeOf::AddLast

void AddLast (const AType * obj)

Interface Category:

API.

Purpose:

Adds an object to the collection.

Calling Context:

Call this function directly to add an object to the end of the collection.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TDequeOf::AddFirst

void AddFirst (const AType * obj)

Interface Category:

API.

Purpose:

Adds an object to the collection.

Calling Context:

Call this function directly to add an object to the beginning of the collection.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TDequeOf::RemoveLast

AType * RemoveLast ()

Interface Category:

API.

Purpose:

Removes an object from the collection.

Calling Context:

Call this function directly to remove an object from the end of the collection.

Parameters:

Return Value:

A reference to the object removed. A NIL pointer is returned if there are no more objects in the collection.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TDequeOf::RemoveFirst

AType * RemoveFirst ()

Interface Category:

API.

Purpose:

Removes an object from the collection.

Calling Context:

Call this function directly to remove an object from the beginning of the collection.

Parameters:

Return Value:

A reference to the object removed. A NIL pointer is returned if there are no more objects in the collection.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TDequeOf::Remove

  1. AType * Remove (const AType &)
  2. AType * Remove ()

Interface Category:

API.

Purpose:

  1. Removes the first object in the collection that is found to match the supplied object.
  2. Removes the first object in the collection.

Calling Context:

  1. Call this function directly to remove an object from the collection that matches the supplied object.
  2. Call this function directly to remove the first object.

Parameters:

Return Value:

A reference to the object removed. A NIL reference is returned if there are no more objects in the collection or if no matching object was found.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TDequeOf::Insert

void Insert (const AType * obj)

Interface Category:

API.

Purpose:

Adds an object to the collection.

Calling Context:

Call this function directly to add an object to the end on the collection.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TDequeOf::Pop

AType * Pop ()

Interface Category:

API.

Purpose:

Removes an object from the collection.

Calling Context:

Call this function directly to remove the first object from the collection.

Parameters:

Return Value:

A reference to the object removed from the collection. A NIL reference is returned if there are no more objects.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TDequeOf::Push

void Push (const AType * obj)

Interface Category:

API.

Purpose:

Adds an object to the collection.

Calling Context:

Call this function directly to add an object to the beginning of the collection.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TDequeOf::operator==

bool operator ==(const TDequeOf < AType > & dequeOf) const

Interface Category:

API.

Purpose:

Tests whether this collection's contents are equivalent to those of the argument.

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 collection's contents are equivalent to those of the argument.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TDequeOf::operator!=

bool operator != (const TDequeOf < AType > & dequeOf) const

Interface Category:

API.

Purpose:

Tests whether this collection's contents are equivalent to those of the argument.

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 collection's contents are not equivalent to those of the argument.

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.