Class: TModelSurrogate

Declaration: CompoundDocument.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

TAbstractModel

Inherited By:

None.

Purpose:

Provides a surrogate to a model object that allows the model to be accessed locally or remotely. Provides only a small subset of the protocol available on TModel. Only models that are contained in a compound document are accessible remotely.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

Derive from TModelSurrogate if you want to provide remote access to additional behavior of TModel and its derived classes.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Member Function: TModelSurrogate::TModelSurrogate

  1. TModelSurrogate (TCompoundDocumentSurrogate *, const TModelReference &)
  2. TModelSurrogate (const TModelSurrogate &)
  3. TModelSurrogate ()

Interface Category:

API.

Purpose:

  1. Creates a surrogate to a specific model in a specific document.
  2. Copy constructor.
  3. Default constructor.

Calling Context:

  1. Call this function directly.
  2. Called to copy an object.
  3. Called by the stream-in operators and derived classes.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

Preconditions: Assertion (TCompoundDocumentSurrogate* != NIL).

Member Function: TModelSurrogate::~TModelSurrogate

virtual ~ TModelSurrogate ()

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: TModelSurrogate::CopyAnchorSelection

virtual TModelSelection* CopyAnchorSelection (const TModelAnchorReference &) const

Interface Category:

API.

Purpose:

Copies the selection owned by the specified anchor.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns a copy of the anchor's selection.

Exceptions:

Throws TCompoundDocumentException::kAnchorDoesNotExist if the anchor is not in the model.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TModelSurrogate::CreateAvailableTypesListForAnchor

virtual void CreateAvailableTypesListForAnchor (const TModelAnchorReference &, TSequenceOf < TTypeDescription > & theTypes) const

Interface Category:

API.

Purpose:

Creates the list of available data types from an anchor contained in the model represented by this surrogate.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws TCompoundDocumentException::kAnchorDoesNotExist if the anchor is not in the model.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TModelSurrogate::ChooseTypesForAnchor

virtual void ChooseTypesForAnchor (const TModelAnchorReference &, const TSequenceOf < TTypeDescription > & theChoices, TSequenceOf < TTypeDescription > & theChosen) const

Interface Category:

API.

Purpose:

Requests an anchor contained in the model represented by this surrogate to choose an appropriate type for data exchange.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws TCompoundDocumentException::kAnchorDoesNotExist if the anchor is not in the model.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TModelSurrogate::CopyAnchorData

virtual TModel * CopyAnchorData (const TModelAnchorReference &, const TTypeDescription & theType) const

Interface Category:

API.

Purpose:

Copies the data specified by an anchor in the model represented by this surrogate. The type requested must be one previously chosen by this anchor.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns the copy of the selected data.

Exceptions:

Throws TCompoundDocumentException::kAnchorDoesNotExist if the anchor is not in the model. Throws TCompoundDocumentException::kTypeUnacceptable if the anchor cannot produce the requested type.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TModelSurrogate::OrphanAnchorData

virtual TModel * OrphanAnchorData (const TModelAnchorReference &) const

Interface Category:

API.

Purpose:

Orphans the data specified by an anchor in the model represented by this surrogate.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns the orphaned data.

Exceptions:

Throws TCompoundDocumentException::kAnchorDoesNotExist if the anchor is not in the model.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TModelSurrogate::UndoOrphanAnchorData

virtual void UndoOrphanAnchorData (const TModelAnchorReference &, TModel * adoptedUndoModel) const

Interface Category:

API.

Purpose:

Undoes a previous orphan of data from an anchor surrogate.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws TCompoundDocumentException::kAnchorDoesNotExist if the anchor is not in the model.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TModelSurrogate::GetWholeModelAnchorReference

virtual TModelAnchorReference GetWholeModelAnchorReference () const

Interface Category:

API.

Purpose:

Gets a reference to the whole model dynamic anchor in this model. surrogate.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns a reference to the whole model anchor in the model.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TModelSurrogate::CopyLink

virtual TModelLink * CopyLink (const TModelLinkReference &) const

Interface Category:

API.

Purpose:

Copies the specified link from the model.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns a copy of the link.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TModelSurrogate::operator=

TModelSurrogate & operator =(const TModelSurrogate &)

Interface Category:

API.

Purpose:

Assignment operator.

Calling Context:

Called when an object is assigned to another compatible object.

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.

Member Function: TModelSurrogate::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: TModelSurrogate::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 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: TModelSurrogate::GetDocumentSurrogate

TCompoundDocumentSurrogate & GetDocumentSurrogate () const

Interface Category:

API.

Purpose:

Returns this object's document surrogate

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns a pointer this object's document surrogate

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TModelSurrogate::GetAnchorModifyDate

virtual void GetAnchorModifyDate (const TModelAnchorReference &, TTime &) const

Interface Category:

API.

Purpose:

Returns the date of the last time the specified anchor was modified.

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.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.