Class: TDeleterFor

Declaration: DeleterFor.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

None.

Inherited By:

None.

Purpose:

Use TDeleterFor to ensure that an object allocated on the heap is deleted as soon as it goes out of scope.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

Do not derive any classes from TDeleterFor.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Other Considerations:

None.

Member Function: TDeleterFor::~TDeleterFor

~ TDeleterFor ()

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: TDeleterFor::AdoptObject

void AdoptObject (AType *)

Interface Category:

API.

Purpose:

Adopts a new object.

Calling Context:

Call this function directly to delete the currently associated object and adopt the new object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TDeleterFor::OrphanObject

AType * OrphanObject ()

Interface Category:

API.

Purpose:

Orphans an object.

Calling Context:

Call this function directly to remove the association with the current object without removing it.

Parameters:

Return Value:

A reference to the object no longer associated with this object. A NIL reference is returned if there was no associated object when this operation was called.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TDeleterFor::GetObject

AType * GetObject () const

Interface Category:

API.

Purpose:

Returns the object associated with this object.

Calling Context:

Call this function directly to obtain a reference to the object associated with this object.

Parameters:

Return Value:

A reference to the object associated with this object. A NIL reference is returned if there was no object associated with this object.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TDeleterFor::operator=

void operator =(AType *)

Interface Category:

API.

Purpose:

Adopts a new object.

Calling Context:

Call this function directly to delete the currently associated object and adopt the new object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TDeleterFor::operator->

AType * operator ->() const

Interface Category:

API.

Purpose:

Returns a reference to the object associated with this object.

Calling Context:

Call this function directly to obtain a reference to the object associated with this object.

Parameters:

Return Value:

A reference to the associated object.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TDeleterFor::TDeleterFor

  1. TDeleterFor ()
  2. TDeleterFor (AType *)

Interface Category:

API.

Purpose:

  1. Creates a TDeleterFor with no associated object.
  2. Creates a TDeleterFor for the specified object.

Calling Context:

  1. Call this function directly.
  2. Call this function directly to create a TDeleterFor for the specified object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TDeleterFor::operatorAType*

operator AType * () const

Interface Category:

API.

Purpose:

Allows you to use this object as the object that it is templatized over.

Calling Context:

Call this function directly when you want to use the object that this deleter is templatized over.

Parameters:

Return Value:

Returns AType*.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TDeleterFor::operator*

AType & operator * () const

Interface Category:

API.

Purpose:

Allows you to dereference this object and allowing it to behave like the object that it is templatized over.

Calling Context:

Call this function directly to dereference this object.

Parameters:

Return Value:

Returns AType &.

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.