Class: TDocumentState

Declaration: BasicDocument.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

MCollectible

Inherited By:

TDocumentComponent

Purpose:

TDocumentState is an abstract class that represents the persistent data of a document. Its sole responsibility is to create a presenter on its data when requested. Basic document developers are expected to derive from this class to provide additional functionality. The Compound Document Framework also derives from this class to provide the compound document building block known as the document component.

Instantiation:

Allocate on the heap or the stack. The Basic Document Framework always allocates it on the heap.

Deriving Classes:

TDocumentState is derived to add type specific content to the document. Derived classes must override the pure virtual function CreateDocumentPresenter and the streaming operators.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Member Function: TDocumentState::TDocumentState

  1. TDocumentState ()
  2. TDocumentState (const TDocumentState &)

Interface Category:

API.

Purpose:

  1. Default constructor.
  2. Copy constructor

Calling Context:

  1. Called by the stream-in operators and derived classes.
  2. Called by derived classes to copy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

The constructors for TDocumentState are protected.

Member Function: TDocumentState::operator=

TDocumentState & operator =(const TDocumentState &)

Interface Category:

API.

Purpose:

Assignment operator.

Calling Context:

Call this function by using the operator in an assignment statement.

Parameters:

Return Value:

Returns a const reference to the left-hand side object.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

This operator is protected. Post Conditions: Assertion (document state's contents are equivalent to source state.)

Member Function: TDocumentState::~TDocumentState

virtual ~ TDocumentState ()

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: TDocumentState::CreateDocumentPresenter

virtual TDocumentPresenter * CreateDocumentPresenter (const TPlaceReference &) const

Interface Category:

API.

Purpose:

Creates a presenter on the whole document. The call to TDocument::CreatePresenter is delegated to this member function. This member function exists only so that different presentations can be created that are specific to the type of document state derived class provided.

Calling Context:

Call this function directly.

Parameters:

Return Value:

TDocumentPresenter * -A presenter that provides a presentation on this document state.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

This function is a pure virtual function and must be overridden by classes deriving from TDocumentState.

Member Function: TDocumentState::operator>>=

virtual TStream & operator >>=(TStream & to) 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:

This operator is a pure virtual function and must be overridden by classes deriving from TDocumentState. Preconditions: Assertion (stream is opened for writing).

Member Function: TDocumentState::operator<<=

virtual TStream & operator <<= (TStream & from)

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:

This operator is a pure virtual function and must be overridden by classes deriving from TDocumentState. Preconditions: Assertion (stream is opened for reading).

Member Function: TDocumentState::GetDocument

TDocumentReference GetDocument() const

Interface Category:

API.

Purpose:

Returns a reference to the document that contains this document state.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns a reference to the document containing this document state. If this document state is not contained in a document, an invalid reference is returned.

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.