Class: TAliasTo

Declaration: SafePointers.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

TPointerTo.

Inherited By:

None.

Purpose:

Warning: This class may be removed in the next release. Contains a pointer to an object, but does not own that object. Like all classes derived from TPointerTo, it can be dereferenced (operator * or operator ->) like a regular pointer; but if it contains NIL (0), dereferencing it throws an exception.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

You should not derive any classes from TAliasTo.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Other Considerations:

None.

Member Function: TAliasTo::TAliasTo

  1. TAliasTo (AType * adopt =NIL)
  2. TAliasTo (const TAliasTo < AType > & alias)

Interface Category:

API.

Purpose:

Warning: This function may be removed in the next release.
  1. Creates a TAliasTo that contains a copy of the specified pointer.
  2. Copy constructor.

Calling Context:

  1. Call this function directly to copy the pointer into the wrapper.
  2. Call this function directly to copy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TAliasTo::operator=

  1. TAliasTo < AType > & operator =(AType * alias)
  2. TAliasTo < AType > & operator =(const TAliasTo < AType > & alias)

Interface Category:

API.

Purpose:

Warning: This function may be removed in the next release.
  1. Copies the pointer.
  2. Copies the pointer.
  3. If the parameter is not NIL, this results in two aliases to the same object.

Calling Context:

  1. Call this function directly to initialize a TAliasTo object from a pointer.
  2. Call this function directly to initialize a TAliasTo object from another TAliasTo object.

Parameters:

Return Value:

A reference to this object.

Exceptions:

Throws no exceptions.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TAliasTo::operatorAType*

operator AType* () const

Interface Category:

API.

Purpose:

Warning: This function may be removed in the next release. Supports implicit conversion of this object to AType*.

Calling Context:

Call this function directly when this object is passed to a function parameter whose formal type is AType*, or assigned to an object of type AType*.

Parameters:

Return Value:

A copy of the pointer contained in this object.

Exceptions:

Throws no exceptions.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TAliasTo::Orphan

AType * Orphan ()

Interface Category:

API.

Purpose:

Warning: This function may be removed in the next release. Returns a copy of the pointer contained in this object, and changes this object to contain NIL.

Calling Context:

Call this function directly to change the pointer contained by this object to NIL.

Parameters:

Return Value:

A copy of the pointer contained in this object.

Exceptions:

Throws no exceptions.

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.