Description

GetAlias() -- returns a copy of the pointer contained in the wrapper. Returns NIL if the wrapper contains a NIL pointer.

IsValid() -- returns true if the wrapper contains a non-NIL pointer, or false if it contains a NIL pointer.

Validate() -- throws an exception if the wrapper contains a NIL pointer.

operator ->(), operator *() -- support pointer-style syntax on a TPointerTo, so that the following statements are legal (assuming TA::f() exists):

      const TPointerTo<TA>& a = ...;
      a->f();
      (*a).f();
These operators check to see if the pointer is NIL; if it is, they throw an exception and do not attempt to follow the pointer.

TPointerTo(AType*) -- copies the pointer into the wrapper.

operator=(AType* ) -- copies the pointer into the wrapper.

~TPointerTo() -- does nothing. It has no effect on the object it points to.

Orphan() -- returns a copy of the pointer contained in the wrapper, and changes the wrapper to contain NIL. GetAlias() will subsequently return NIL.

CopyPointer (const TPointerTo<AType>& from...) -- copies the object (if any) to which the wrapper points, and returns a pointer to the copy. Returns NIL if the wrapper contains NIL. This function won't compile unless AType is copyable; that is, unless CopyPointer(AType*) is available.

Flatten (const TPointerTo<AType>& from, TStream& into) -- flattens the object to which the wrapper points into the given stream. This function won't compile unless AType is flattenable; that is, unless Flatten(AType*, TStream&) is available.

StreamOutLengthAndFlatten (const TPointerTo<AType>& from, TStream& into) -- flattens the object to which the wrapper points into the given stream, preceded by the length (in the stream) of its flattened representation. This function won't compile unless AType is flattenable.


[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker