Class: TAbstractDocumentFunctor

Declaration: BasicDocument.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

MCollectible

Inherited By:

TAbstractModelFunctor TCompoundDocumentFunctor TDocumentFunctor

Purpose:

The TAbstractDocumentFunctor class is the abstract base class for the document functor type. Functors of this type can act on a document or on one or more document containees. A functor acts on a document surrogate. The functor is sent to the corresponding real document instance and performed there. If the document instance is remote, the document functor must be streamed out and sent across to the remote document server process.

Abstract base class; do not allocate.

Deriving Classes:

TAbstractDocumentFunctor provides the base for other more specific abstract functor classes and is not usually derived from by framework clients.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Invariants:

Functors do not maintain state.

Member Function: TAbstractDocumentFunctor::~TAbstractDocumentFunctor

virtual ~ TAbstractDocumentFunctor ()

Interface Category:

API.

Purpose:

Destructor.

Calling Context:

Called 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: TAbstractDocumentFunctor::operator>>=

virtual TStream & operator >>=(TStream &) const

Interface Category:

API.

Purpose:

Stream-out operator.

Calling Context:

Called to stream out data.

Parameters:

Return Value:

Returns a reference to the stream the object streams itself out to.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TAbstractDocumentFunctor::operator<<=

virtual TStream & operator <<= (TStream &)

Interface Category:

API.

Purpose:

Stream-in operator.

Calling Context:

Called to stream in data.

Parameters:

Return Value:

Returns a reference to the stream the object streams itself in from.

Exceptions:

Throws a TInvalidVersionError if the version of the object on the stream is unknown to the version of the shared library installed.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TAbstractDocumentFunctor::TAbstractDocumentFunctor

  1. TAbstractDocumentFunctor ()
  2. TAbstractDocumentFunctor (const TAbstractDocumentFunctor& );

Interface Category:

API.

Purpose:

  1. Default constructor.
  2. Copy constructor.

Calling Context:

Called only by derived classes.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

The constructors for this class are protected.

Member Function: TAbstractDocumentFunctor::HasBeenDone

bool HasBeenDone ()

Interface Category:

API.

Purpose:

Determines whether the functor has been done yet. If the functor has not been done, streaming the object calls only the HandleStream*Arguments functions. If it has been done, streaming the object calls the HandleStream*Results functions.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TAbstractDocumentFunctor::SendTo

void SendTo (const TDocumentSurrogate &)

Interface Category:

API.

Purpose:

Sends the functor to the specified target document.

Calling Context:

Called by derived classes to send the functor to the target document for execution. If the surrogate is for a document in another task, the surrogate handles forwarding of the functor to the target document.

Parameters:

Return Value:

None.

Exceptions:

Throws TDocumentException(kUndefinedDocumentReference) if the document reference for the surrogate has not been defined. Throws TDocumentException(kFunctorHasAlreadyBeenDone) if the functor was previously sent and done. Other exceptions are passed through.

Concurrency:

Not multithread safe.

Other Considerations:

This function is protected.

Member Function: TAbstractDocumentFunctor::MarkAsDone

void MarkAsDone ()

Interface Category:

API.

Purpose:

Marks the functor as done. If the functor has not been done, streaming the object calls only the HandleStream*Arguments functions. If it has been done, streaming the object calls the HandleStream*Results functions.

Calling Context:

Called by derived classes to mark the functor as done.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

This function is protected.

Member Function: TAbstractDocumentFunctor::HandleStreamOutArguments

virtual void HandleStreamOutArguments (TStream &) const

Interface Category:

API.

Purpose:

Streams out functor arguments. Arguments are only streamed if the functor has not yet been done.

Calling Context:

Called to stream out data before Do when the functor is executed remotely.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

This function is protected. PreConditions: Assertion ( HasBeenDone() ==false ).

Member Function: TAbstractDocumentFunctor::HandleStreamInArguments

virtual void HandleStreamInArguments (TStream &)

Interface Category:

API.

Purpose:

Streams in functor arguments. Arguments are only streamed if the functor has not yet been done.

Calling Context:

Called to stream in data before Do when the functor is executed remotely.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

This function is protected. PreConditions: Assertion ( HasBeenDone() ==false ).

Member Function: TAbstractDocumentFunctor::HandleStreamOutResults

virtual void HandleStreamOutResults (TStream &) const

Interface Category:

API.

Purpose:

Streams out functor results. Results are only streamed if the functor has already been done.

Calling Context:

Called to stream out data after Do when the functor is executed remotely.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

This function is protected. PreConditions: Assertion ( HasBeenDone() ==true ).

Member Function: TAbstractDocumentFunctor::HandleStreamInResults

virtual void HandleStreamInResults (TStream &)

Interface Category:

API.

Purpose:

Streams in functor results. Results are only streamed if the functor has already been done.

Calling Context:

Called to stream in data after Do when the functor is executed remotely.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

This function is protected. PreConditions: Assertion ( HasBeenDone() ==false ).
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.