Class: TCompoundDocumentSurrogate

Declaration: CompoundDocument.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

TDocumentSurrogate, MCompoundDocument

Inherited By:

None.

Purpose:

Provides a surrogate for a compound document object that allows both local and remote access to the document. All surrogate functions are implemented using functors. If the document is local, the functor acts locally. If the document is remote, the functor is streamed to the remote document and acts there. The first surrogate causes the Document Registry to start the process. When the last surrogate goes away, the document server process dies.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

Do not derive from TCompoundDocumentSurrogate.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Member Function: TCompoundDocumentSurrogate::TCompoundDocumentSurrogate

  1. TCompoundDocumentSurrogate (const TCompoundDocumentSurrogate &)
  2. TCompoundDocumentSurrogate (const TDocumentReference &, TStore::EAccessMode aMode =TStore::kReadWrite, TDocumentStore::ESharingMode sMode =TDocumentStore::kNonShared)
  3. TCompoundDocumentSurrogate ()

Interface Category:

API.

Purpose:

  1. Copy constructor.
  2. Creates a surrogate, given a reference to the document.
  3. Default constructor. This is for internal use by Resurrect.

Calling Context:

  1. Called to copy an object.
  2. You can call this function directly to create surrogate on a document.
  3. Only for internal use by Resurrect. Developers should treat as protected.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

The default constructor is protected.

Member Function: TCompoundDocumentSurrogate::~TCompoundDocumentSurrogate

virtual ~ TCompoundDocumentSurrogate ()

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: TCompoundDocumentSurrogate::GetRootModelReference

virtual TModelReference GetRootModelReference () const

Interface Category:

API.

Purpose:

Provides access to the model in the root document component of the document. A compound document is a hierarchy of document components. The root component is owned and managed by the document.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns a reference to the model in the root component of the document.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TCompoundDocumentSurrogate::GetRootPresenterStateReference

virtual TPresenterStateReference GetRootPresenterStateReference () const

Interface Category:

API.

Purpose:

Provides access to the presenter state in the root document component of the document. A compound document is a hierarchy of document components. The root component is owned and managed by the document.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns a reference to the presenter state in the root component of the document.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TCompoundDocumentSurrogate::GetRootComponentReference

virtual TDocumentComponentReference GetRootComponentReference () const

Interface Category:

API.

Purpose:

Provides access to the root document component of the document. A compound document is a hierarchy of document components. The root component is owned and managed by the document.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns a reference to the root component of the document.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TCompoundDocumentSurrogate::CanDo

virtual bool CanDo (TAbstractDocumentComponentCommandBinding &) const

Interface Category:

API.

Purpose:

Determines whether or not the command in the command binding is doable in the context of the document to which it is applied. If the document is remote, the command is sent to the document's team, and CanDo is called.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns true if the command can be done on a target document; false otherwise.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TCompoundDocumentSurrogate::AdoptAndDo

  1. void AdoptAndDo (TCommandBinding *)
  2. virtual void AdoptAndDo (TAbstractDocumentComponentCommandBinding *)

Interface Category:

API.

Purpose:

  1. Adopts and executes the simple command binding. The binding is deleted after it is executed.
  2. Adopts a document component command binding and executes it.

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: TCompoundDocumentSurrogate::DoBegin

virtual void DoBegin (TAbstractDocumentComponentCommandBinding &)

Interface Category:

API.

Purpose:

Takes an incremental command and begins execution. The binding contains a command and target, which can be a model selection or a presenter state selection. Modify document data only using commands. The command is added to the document history if it modifies the document and is undoable. If it modifies the document and is not undoable, the document history is cleared. Only one incremental command can be outstanding at any one time. If another command is started, the currently executing incremental command is automatically ended.

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: TCompoundDocumentSurrogate::DoIncrement

virtual void DoIncrement (TAbstractDocumentComponentCommandBinding &)

Interface Category:

API.

Purpose:

Takes an incremental command and continues execution. The command binding must be the same binding used in a previous DoBegin.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws TCompoundDocumentException::kExpectedDoBegin if DoBegin was not previously called for this command.

Concurrency:

Not multithread safe.

Other Considerations:

Preconditions: Assertion (DoBegin previously called for this command).

Member Function: TCompoundDocumentSurrogate::AdoptAndDoEnd

virtual void AdoptAndDoEnd (TAbstractDocumentComponentCommandBinding *)

Interface Category:

API.

Purpose:

Adopts an incremental command and ends execution. The command binding must be the same binding used in a previous DoBegin.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws TCompoundDocumentException::kExpectedDoBegin if DoBegin was not previously called for this command.

Concurrency:

Not multithread safe.

Other Considerations:

Preconditions: Assertion (DoBegin previously called for this command).

Member Function: TCompoundDocumentSurrogate::GetUndoRedoStatus

virtual void GetUndoRedoStatus (bool & undoAllowed, bool & redoAllowed) const

Interface Category:

API.

Purpose:

Returns the status on the availability of commands in the command history for undo and redo.

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: TCompoundDocumentSurrogate::HistoryUndo

virtual void HistoryUndo ()

Interface Category:

API.

Purpose:

Undoes the last command done for the document. This undoes the last command completed or an incremental command that is still in progress. The incremental command is ended before it is undone.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws kNoCommandsToUndo if a command is not available for undo.

Concurrency:

Not multithread safe.

Other Considerations:

Preconditions: Assertion(GetUndoRedoStatus returns undoAllowed ==true).

Member Function: TCompoundDocumentSurrogate::HistoryRedo

virtual void HistoryRedo ()

Interface Category:

API.

Purpose:

Redoes the last command undone for the document.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws kNoCommandsToRedo if a command is not available for redo.

Concurrency:

Not multithread safe.

Other Considerations:

Preconditions: Assertion(GetUndoRedoStatus returns redoAllowed ==true).

Member Function: TCompoundDocumentSurrogate::operator>>=

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

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

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 no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TCompoundDocumentSurrogate::operator!=

bool operator != (const TCompoundDocumentSurrogate &) const

Interface Category:

API.

Purpose:

Tests whether the two objects on either side of the != symbol are equal.

Calling Context:

Call this function by using the operator in an expression.

Parameters:

Return Value:

Returns true if the two objects are not equal.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TCompoundDocumentSurrogate::operator==

bool operator ==(const TCompoundDocumentSurrogate &) const

Interface Category:

API.

Purpose:

Tests whether the two objects on either side of the ==symbol are equal.

Calling Context:

Call this function by using the operator in an expression.

Parameters:

Return Value:

Returns true if the two objects are equal.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TCompoundDocumentSurrogate::operator=

TCompoundDocumentSurrogate & operator =(const TCompoundDocumentSurrogate &)

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:

None.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.