Class: TModel

Declaration: CompoundDocument.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

TAbstractModel

Inherited By:

TMediaModel TEmbedderModel TGUIEmbedderModel TStandardCanvasModel TTextModel

Purpose:

The model provides an interface needed by the Compound Document Framework to manage its native data types in a compound document. This is a core class for the Compound Document Framework. All data types used with the Compound Document Framework are derived from TModel.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

All new data types to be used in the Compound Document Framework must derive from TModel. Derived classes must override the pure virtual function CreateSelection.

Concurrency:

Not multithread safe. Models contained in document components can be safely accessed concurrently by obtaining a TDocumentComponentReadEntry or TDocumentComponentWriteEntry prior to looking up the model from a reference.

Resource Use:

No special requirements.

Member Function: TModel::~TModel

virtual ~ TModel ()

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. Models contained in document components can be safely accessed concurrently by obtaining a TDocumentComponentReadEntry or TDocumentComponentWriteEntry prior to looking up the model from a reference.

Other Considerations:

None.

Member Function: TModel::LookupForWriting

static TModel * LookupForWriting (const TModelReference &)

Interface Category:

API.

Purpose:

Looks up a model from a reference for read/write access.

Calling Context:

Called to access a model safely in a concurrent environment.

Parameters:

Return Value:

Returns a pointer to a TModel object.

Exceptions:

Throws TCompoundDocumentException::KModelDoesNotExist if the model is not in the document. Throws TCompoundDocumentException::kModelNotLocked if the component containing the model is not read/write locked. To lock the component, a TDocumentComponentWriteEntry for the component must be in scope at the time of lookup. The model pointer must not be held outside the scope of the entry.

Concurrency:

Not multithread safe. Models contained in document components can be safely accessed concurrently by obtaining a TDocumentComponentReadEntry or TDocumentComponentWriteEntry prior to looking up the model from a reference.

Other Considerations:

Preconditions: Assertion( the associated model is read-write locked or is not inside a document ).

Member Function: TModel::LookupForReading

static const TModel * LookupForReading (const TModelReference &)

Interface Category:

API.

Purpose:

Looks up a model from a reference for read access.

Calling Context:

Called to access a model safely in a concurrent environment.

Parameters:

Return Value:

Returns a const pointer to a TModel instance.

Exceptions:

Throws TCompoundDocumentException::kModelDoesNotExist if the model is not in the document. Throws TCompoundDocumentException::kModelNotLocked if the component containing the model is not locked.

Concurrency:

Not multithread safe. Models contained in document components can be safely accessed concurrently by obtaining a TDocumentComponentReadEntry or TDocumentComponentWriteEntry prior to looking up the model from a reference.

Other Considerations:

Preconditions: Assertion( the associated model is read locked or is not inside a document ).

Member Function: TModel::CreateSelection

virtual TModelSelection * CreateSelection () const

Interface Category:

API.

Purpose:

Virtual constructor that provides a compatible selection for this model. The return selection is undefined.

Calling Context:

Called to virtually construct a selection for this model.

Parameters:

Return Value:

Returns a selection of a compatible class for this model.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe. Models contained in document components can be safely accessed concurrently by obtaining a TDocumentComponentReadEntry or TDocumentComponentWriteEntry prior to looking up the model from a reference.

Other Considerations:

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

Member Function: TModel::FileIn

virtual void FileIn (TStorageMechanism &)

Interface Category:

API.

Purpose:

Files the model's data in from persistent store.

Calling Context:

Called by the Compound Document Framework when a model is looked up and is not found in the memory.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe. Models contained in document components can be safely accessed concurrently by obtaining a TDocumentComponentReadEntry or TDocumentComponentWriteEntry prior to looking up the model from a reference.

Other Considerations:

None.

Member Function: TModel::FileOut

virtual void FileOut (TStorageMechanism &) const

Interface Category:

API.

Purpose:

To file the model's data out to persistent store.

Calling Context:

Called by the Compound Document Framework when a model is committed to store.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe. Models contained in document components can be safely accessed concurrently by obtaining a TDocumentComponentReadEntry or TDocumentComponentWriteEntry prior to looking up the model from a reference.

Other Considerations:

None.

Member Function: TModel::CreateComponentStore

virtual TDocumentComponentStore * CreateComponentStore (TDocumentStore & theDocStore, const TSequenceOf < TTypeDescription > &)

Interface Category:

API.

Purpose:

Requests the model to create a compatible store in which it stores persistent data. A list of types for existing stores are passed so the model can choose to create a store of an existing type, which can provide implementation sharing between stores if the store supports such behavior.

Calling Context:

Called by the Compound Document Framework when a model is added to the document embedding hierarchy.

Parameters:

Return Value:

Returns a compatible store in which this model stores its persistent data.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe. Models contained in document components can be safely accessed concurrently by obtaining a TDocumentComponentReadEntry or TDocumentComponentWriteEntry prior to looking up the model from a reference.

Other Considerations:

None.

Member Function: TModel::StartUsingStorageMechanism

virtual void StartUsingStorageMechanism (TStorageMechanism *)

Interface Category:

API.

Purpose:

Provides the model with a storage mechanism used to save persistent data.

Calling Context:

Called by the Compound Document Framework when a model is added to the embedding hierarchy.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe. Models contained in document components can be safely accessed concurrently by obtaining a TDocumentComponentReadEntry or TDocumentComponentWriteEntry prior to looking up the model from a reference.

Other Considerations:

Preconditions: Assertion (TStorageMechanism * != NIL).

Member Function: TModel::StopUsingStorageMechanism

virtual void StopUsingStorageMechanism (const TStorageMechanism &)

Interface Category:

API.

Purpose:

Informs the model that the storage mechanism is no longer available for use.

Calling Context:

Called by the Compound Document Framework when a model is removed from the embedding hierarchy.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe. Models contained in document components can be safely accessed concurrently by obtaining a TDocumentComponentReadEntry or TDocumentComponentWriteEntry prior to looking up the model from a reference.

Other Considerations:

None.

Member Function: TModel::IsContentEqual

virtual bool IsContentEqual (const TModel &) const

Interface Category:

API.

Purpose:

Compares the contents of this model to those of another.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns true if contents of the two models are equal.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe. Models contained in document components can be safely accessed concurrently by obtaining a TDocumentComponentReadEntry or TDocumentComponentWriteEntry prior to looking up the model from a reference.

Other Considerations:

None.

Member Function: TModel::ContentHash

virtual HashResult ContentHash () const

Interface Category:

API.

Purpose:

Speeds content comparison. IsContentEqual does not need to be called if the hash values of two models are not identical.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns the hash value for model content.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe. Models contained in document components can be safely accessed concurrently by obtaining a TDocumentComponentReadEntry or TDocumentComponentWriteEntry prior to looking up the model from a reference.

Other Considerations:

None.

Member Function: TModel::GetTimeStamp

TPseudoTimeStamp GetTimeStamp () const

Interface Category:

API.

Purpose:

Provides access to the model's time stamp. This stamp is updated every time data held by the model is modified.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns the model's time stamp.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe. Models contained in document components can be safely accessed concurrently by obtaining a TDocumentComponentReadEntry or TDocumentComponentWriteEntry prior to looking up the model from a reference.

Other Considerations:

None.

Member Function: TModel::IsAnchorable

virtual bool IsAnchorable () const

Interface Category:

API.

Purpose:

Queries the model on whether it supports creating anchors on its data.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns true if the model supports anchors. true is also returned by default.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe. Models contained in document components can be safely accessed concurrently by obtaining a TDocumentComponentReadEntry or TDocumentComponentWriteEntry prior to looking up the model from a reference.

Other Considerations:

None.

Member Function: TModel::IsReadable

virtual bool IsReadable () const

Interface Category:

API.

Purpose:

Queries the model on whether it allows copying of its data.

Calling Context:

Call this function directly. Typically used by commands that copy data.

Parameters:

Return Value:

Returns true if the model allows data to be copied. It also returns true by default.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe. Models contained in document components can be safely accessed concurrently by obtaining a TDocumentComponentReadEntry or TDocumentComponentWriteEntry prior to looking up the model from a reference.

Other Considerations:

None.

Member Function: TModel::IsWriteable

virtual bool IsWriteable () const

Interface Category:

API.

Purpose:

Queries the model as to whether it allows its data to be modified.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns true if model is writable. The default delegates to storage.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe. Models contained in document components can be safely accessed concurrently by obtaining a TDocumentComponentReadEntry or TDocumentComponentWriteEntry prior to looking up the model from a reference.

Other Considerations:

None.

Member Function: TModel::IsAnnotatable

virtual bool IsAnnotatable () const

Interface Category:

API.

Purpose:

Queries the model as to whether annotation is allowed.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns true if annotation is allowed. The default returns IsWriteable.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe. Models contained in document components can be safely accessed concurrently by obtaining a TDocumentComponentReadEntry or TDocumentComponentWriteEntry prior to looking up the model from a reference.

Other Considerations:

None.

Member Function: TModel::IsOrphanable

virtual bool IsOrphanable () const

Interface Category:

API.

Purpose:

Queries the model as to whether orphaning of the model data is allowed.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns true if orphaning is allowed. The default returns IsOrphanable.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe. Models contained in document components can be safely accessed concurrently by obtaining a TDocumentComponentReadEntry or TDocumentComponentWriteEntry prior to looking up the model from a reference.

Other Considerations:

None.

Member Function: TModel::AdoptAnchor

virtual void AdoptAnchor (TModelAnchor * anAnchor)

Interface Category:

API.

Purpose:

Adopts anAnchor into this model. The anchor must be a sticky selection on data contained in this model. This model takes responsibility for the storage of anAnchor. The notification kAddedAnchor is generated.

Calling Context:

Called from a command.

Parameters:

Return Value:

None.

Exceptions:

Throws TDocumentException::kAnchorAlreadyInModel if this anchor has already been adopted into the model. Throws TDocumentException::kWrongModelForAnchor if this anchor is for data in another model. Throws TDocumentException::kNILAnchor if this anchor is NIL.

Concurrency:

Not multithread safe. Models contained in document components can be safely accessed concurrently by obtaining a TDocumentComponentReadEntry or TDocumentComponentWriteEntry prior to looking up the model from a reference.

Other Considerations:

Preconditions: Assertion (TAnchor* != NIL). Assertion (LookupAnchor(*TAnchor) ==NIL). Assertion (GetReference() ==TModelReference(TAnchor->GetReference())). Postconditions: Assert (LookupAnchor(*TAnchor) != NIL).

Member Function: TModel::OrphanAnchor

virtual TModelAnchor * OrphanAnchor (const TModelAnchorReference & anAnchor)

Interface Category:

API.

Purpose:

Orphans the anchor specified by anAnchor from this model.The orphaned anchor becomes the responsibility of the caller. The notification kRemovedAnchor is generated.

Calling Context:

Called by a command.

Parameters:

Return Value:

None.

Exceptions:

Throws TCompoundDocumentException::kAnchorDoesNotExist if the anchor does not exist for this model.

Concurrency:

Not multithread safe. Models contained in document components can be safely accessed concurrently by obtaining a TDocumentComponentReadEntry or TDocumentComponentWriteEntry prior to looking up the model from a reference.

Other Considerations:

Preconditions: Assertion (LookupAnchor(anAnchor) ==true). Postconditions: Assertion (LookupAnchor(anAnchor) ==false).

Member Function: TModel::LookupAnchor

virtual TModelAnchor * LookupAnchor (const TModelAnchorReference & anAnchor) const

Interface Category:

API.

Purpose:

Given a TModelAnchorReference to an anchor in this model, returns the real TModelAnchor object that anAnchor is a reference for.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns the anchor referred to by the reference.

Exceptions:

Throws TCompoundDocumentException::KAnchorDoesNotExist if the anchor was not found in the model.

Concurrency:

Not multithread safe. Models contained in document components can be safely accessed concurrently by obtaining a TDocumentComponentReadEntry or TDocumentComponentWriteEntry prior to looking up the model from a reference.

Other Considerations:

None.

Member Function: TModel::CreateAnchorIterator

virtual TIteratorOver < TModelAnchor > * CreateAnchorIterator (bool includeInvisibleAnchors =false) const

Interface Category:

API.

Purpose:

Returns an iterator for all the anchors contained in this model.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns an iterator over the anchors in the model.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe. Models contained in document components can be safely accessed concurrently by obtaining a TDocumentComponentReadEntry or TDocumentComponentWriteEntry prior to looking up the model from a reference.

Other Considerations:

None.

Member Function: TModel::GetWholeModelAnchorReference

virtual TModelAnchorReference GetWholeModelAnchorReference ()

Interface Category:

API.

Purpose:

Returns a reference for this model's whole model dynamic anchor. This anchor always contains a selection on the entire contents of the model.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns a reference to the whole model anchor for this model.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe. Models contained in document components can be safely accessed concurrently by obtaining a TDocumentComponentReadEntry or TDocumentComponentWriteEntry prior to looking up the model from a reference.

Other Considerations:

None.

Member Function: TModel::AdoptLink

virtual void AdoptLink (TModelLink * aLink)

Interface Category:

API.

Purpose:

Adopts aLink into this model. The link must be out of an anchor contained in this model. The notification kAddedLink is generated.

Calling Context:

Must be called by a command.

Parameters:

Return Value:

None.

Exceptions:

Throws TCompoundDocumentException::kWrongAnchorForLink if the link is not out of an anchor already in this model. Throws TCompoundDocumentException::kLinkAlreadyInAnchor if the link is already in the anchor. Throws TCompoundDocumentException::kNILLLink if the link is NIL.

Concurrency:

Not multithread safe. Models contained in document components can be safely accessed concurrently by obtaining a TDocumentComponentReadEntry or TDocumentComponentWriteEntry prior to looking up the model from a reference.

Other Considerations:

Preconditions: Assertion (LookupAnchor(TModelAnchorReference(*aLink)) != NIL). Assertion (LookupLink(*aLink) ==NIL). Postconditions: Assertion (LookupLink(*aLink) != NIL).

Member Function: TModel::OrphanLink

virtual TModelLink * OrphanLink (const TModelLinkReference & aLink)

Interface Category:

API.

Purpose:

Orphans the link specified by aLink from this model. The orphaned link becomes the responsibility of the caller. The notification kRemovedLink is generated.

Calling Context:

Called by a command.

Parameters:

Return Value:

Returns the orphaned link.

Exceptions:

Throws TCompoundDocumentException::kAnchorDoesNotExist if the link is not out of an anchor already in this model. Throws TCompoundDocumentException::kLinkDoesNotExist if the link is not in the anchor.

Concurrency:

Not multithread safe. Models contained in document components can be safely accessed concurrently by obtaining a TDocumentComponentReadEntry or TDocumentComponentWriteEntry prior to looking up the model from a reference.

Other Considerations:

Preconditions: Assertion (LookupAnchor(TModelAnchorReference(*aLink)) != NIL). Assertion (LookupLink(*aLink) != NIL). Postconditions: Assertion (LookupLink(*aLink) ==NIL).

Member Function: TModel::LookupLink

virtual TModelLink * LookupLink (const TModelLinkReference & aLink) const

Interface Category:

API.

Purpose:

Given a TModelLinkReference, returns the real TModelLink object that aLink is a reference for.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns the link the aLink refers to.

Exceptions:

Throws TCompoundDocumentException::kAnchorDoesNotExist if the link is not out of an anchor already in this model. Throws TCompoundDocumentException::kLinkDoesNotExist if the link is not in the anchor.

Concurrency:

Not multithread safe. Models contained in document components can be safely accessed concurrently by obtaining a TDocumentComponentReadEntry or TDocumentComponentWriteEntry prior to looking up the model from a reference.

Other Considerations:

None.

Member Function: TModel::AddStyle

void AddStyle (const TModelStyle & theStyle)

Interface Category:

API.

Purpose:

Adds a style to this model's style set.

Calling Context:

Called by a command.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe. Models contained in document components can be safely accessed concurrently by obtaining a TDocumentComponentReadEntry or TDocumentComponentWriteEntry prior to looking up the model from a reference.

Other Considerations:

None.

Member Function: TModel::DeleteStyle

void DeleteStyle (const TModelStyle & patternToMatch)

Interface Category:

API.

Purpose:

Deletes a style contained in this model if it exists.

Calling Context:

Called by a command.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe. Models contained in document components can be safely accessed concurrently by obtaining a TDocumentComponentReadEntry or TDocumentComponentWriteEntry prior to looking up the model from a reference.

Other Considerations:

None.

Member Function: TModel::LookupStyle

  1. const TModelStyle * LookupStyle (const TModelStyle & patternToMatch, bool includeAncestors =false) const
  2. const TModelStyle * LookupStyle (const TModelStyle & patternToMatch, const TDocumentComponentReference & theChild, bool includeAncestors =false) const

Interface Category:

API.

Purpose:

  1. Looks up up a style matching the specified pattern in the model's style set.
  2. Looks up a style matching the specified pattern given a document component reference in the model. The default looks up the style in the model's style set.

Calling Context:

  1. Call this function directly.
  2. Call this function directly.

Parameters:

Return Value:

Returns the style if found, NIL otherwise.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe. Models contained in document components can be safely accessed concurrently by obtaining a TDocumentComponentReadEntry or TDocumentComponentWriteEntry prior to looking up the model from a reference.

Other Considerations:

None.

Member Function: TModel::DeleteAllStyles

void DeleteAllStyles ()

Interface Category:

API.

Purpose:

Deletes all the styles contained in this model's style set.

Calling Context:

Called by a command.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe. Models contained in document components can be safely accessed concurrently by obtaining a TDocumentComponentReadEntry or TDocumentComponentWriteEntry prior to looking up the model from a reference.

Other Considerations:

None.

Member Function: TModel::CreateStyleIterator

TIteratorOver < TModelStyle > * CreateStyleIterator () const

Interface Category:

API.

Purpose:

Creates an iterator over the styles in this model's style set.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns an iterator providing iteration over all the styles in the model's style set.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe. Models contained in document components can be safely accessed concurrently by obtaining a TDocumentComponentReadEntry or TDocumentComponentWriteEntry prior to looking up the model from a reference.

Other Considerations:

None.

Member Function: TModel::DeleteStore

virtual void DeleteStore()

Interface Category:

API.

Purpose:

Deletes the TDocumentComponentStore associated with the component that contains this model. The component stores for all children of the component are also deleted. If the model is not contained in a component, the stores of any child components are still deleted.

Calling Context:

This is called when the deletion of a component is committed, and the storage will never be used again.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe. Models contained in document components can be safely accessed concurrently by obtaining a TDocumentComponentReadEntry or TDocumentComponentWriteEntry prior to looking up the model from a reference.

Other Considerations:

None.

Member Function: TModel::GetAddedLinkInterest

TModelInterest GetAddedLinkInterest () const

Interface Category:

API.

Purpose:

Returns an interest in notifications of links added to this model. The notifications are delivered in a TModelLinkNotification object.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns the interest.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe. Models contained in document components can be safely accessed concurrently by obtaining a TDocumentComponentReadEntry or TDocumentComponentWriteEntry prior to looking up the model from a reference.

Other Considerations:

None.

Member Function: TModel::GetRemovedLinkInterest

TModelInterest GetRemovedLinkInterest () const

Interface Category:

API.

Purpose:

Returns an interest in notifications of links removed from this model. The notifications are delivered in a TModelLinkNotification object.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns the interest.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe. Models contained in document components can be safely accessed concurrently by obtaining a TDocumentComponentReadEntry or TDocumentComponentWriteEntry prior to looking up the model from a reference.

Other Considerations:

None.

Member Function: TModel::GetAddedAnchorInterest

TModelInterest GetAddedAnchorInterest () const

Interface Category:

API.

Purpose:

Returns an interest in notifications of anchors added to this model. This notifications are delivered in a TModelAnchorNotification object.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns the interest.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe. Models contained in document components can be safely accessed concurrently by obtaining a TDocumentComponentReadEntry or TDocumentComponentWriteEntry prior to looking up the model from a reference.

Other Considerations:

None.

Member Function: TModel::GetRemovedAnchorInterest

TModelInterest GetRemovedAnchorInterest () const

Interface Category:

API.

Purpose:

Returns an interest in notifications of anchors removed from this model. The notifications are delivered in a TModelAnchorNotification object.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns the interest.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe. Models contained in document components can be safely accessed concurrently by obtaining a TDocumentComponentReadEntry or TDocumentComponentWriteEntry prior to looking up the model from a reference.

Other Considerations:

None.

Member Function: TModel::GetAnchorContentsReplacedInterest

TModelInterest GetAnchorContentsReplacedInterest () const

Interface Category:

API.

Purpose:

Returns an interest in notifications on changes to data in this model that result from data exchange through an anchor. Notifications are delivered in a TModelAnchorNotification object.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns the interest.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe. Models contained in document components can be safely accessed concurrently by obtaining a TDocumentComponentReadEntry or TDocumentComponentWriteEntry prior to looking up the model from a reference.

Other Considerations:

None.

Member Function: TModel::GetSelectedContentsClearedInterest

TModelInterest GetSelectedContentsClearedInterest () const

Interface Category:

API.

Purpose:

Returns an interest in notifications on data deleted from this model that resulted from data exchange through a selection. Notifications are delivered in a TDualSelectionNotification object.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns the interest.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe. Models contained in document components can be safely accessed concurrently by obtaining a TDocumentComponentReadEntry or TDocumentComponentWriteEntry prior to looking up the model from a reference.

Other Considerations:

None.

Member Function: TModel::GetSelectedContentsReplacedInterest

TModelInterest GetSelectedContentsReplacedInterest () const

Interface Category:

API.

Purpose:

Returns an interest in notifications on changes to data in this model that result from data exchange through a selection. Notifications are delivered in a TDualSelectionNotification object.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns the interest.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe. Models contained in document components can be safely accessed concurrently by obtaining a TDocumentComponentReadEntry or TDocumentComponentWriteEntry prior to looking up the model from a reference.

Other Considerations:

None.

Member Function: TModel::GetStaleDataOnLinkInterest

TModelInterest GetStaleDataOnLinkInterest () const

Interface Category:

API.

Purpose:

Returns an interest in notifications on data changing at the other end of links contained in this document. Notifications are delivered in a TModelLinkNotification object.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns the interest.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe. Models contained in document components can be safely accessed concurrently by obtaining a TDocumentComponentReadEntry or TDocumentComponentWriteEntry prior to looking up the model from a reference.

Other Considerations:

None.

Member Function: TModel::GetAllChangesInterest

TModelInterest GetAllChangesInterest () const

Interface Category:

API.

Purpose:

Returns an interest in all notifications generated by this model. The notifications are delivered with the interest and type of that specified by the specific interest.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns the interest.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe. Models contained in document components can be safely accessed concurrently by obtaining a TDocumentComponentReadEntry or TDocumentComponentWriteEntry prior to looking up the model from a reference.

Other Considerations:

None.

Member Function: TModel::NotifyOfChange

virtual void NotifyOfChange (const TNotification &)

Interface Category:

API.

Purpose:

Notifies clients that a change has occurred in this model. The time stamp for this model is updated.

Calling Context:

Called by derived classes and client selections.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe. Models contained in document components can be safely accessed concurrently by obtaining a TDocumentComponentReadEntry or TDocumentComponentWriteEntry prior to looking up the model from a reference.

Other Considerations:

None.

Member Function: TModel::NotifyButNoChange

virtual void NotifyButNoChange (const TNotification &) const

Interface Category:

API.

Purpose:

Notifies clients of the status in this model. This member function should not be used to notify of changes to the model, because it does not update the time stamp. It can be used to notify of the availability of some remotely accessed data.

Calling Context:

Called by derived classes.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe. Models contained in document components can be safely accessed concurrently by obtaining a TDocumentComponentReadEntry or TDocumentComponentWriteEntry prior to looking up the model from a reference.

Other Considerations:

None.

Member Function: TModel::operator=

TModel & operator =(const TModel &)

Interface Category:

API.

Purpose:

Assignment operator.

Calling Context:

Called when an object is assigned to another compatible object.

Parameters:

Return Value:

Returns a reference to the left-hand side object.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe. Models contained in document components can be safely accessed concurrently by obtaining a TDocumentComponentReadEntry or TDocumentComponentWriteEntry prior to looking up the model from a reference.

Other Considerations:

None.

Member Function: TModel::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. Models contained in document components can be safely accessed concurrently by obtaining a TDocumentComponentReadEntry or TDocumentComponentWriteEntry prior to looking up the model from a reference.

Other Considerations:

None.

Member Function: TModel::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. Models contained in document components can be safely accessed concurrently by obtaining a TDocumentComponentReadEntry or TDocumentComponentWriteEntry prior to looking up the model from a reference.

Other Considerations:

None.

Member Function: TModel::TModel

  1. TModel (const TDocumentReference &)
  2. TModel ()
  3. TModel (const TModel &)

Interface Category:

API.

Purpose:

  1. Create a model to be contained in a specific document.
  2. Default constructor.
  3. Copy constructor.

Calling Context:

  1. Called by derived classes.
  2. Called by derived classes.
  3. Called by derived classes to copy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe. Models contained in document components can be safely accessed concurrently by obtaining a TDocumentComponentReadEntry or TDocumentComponentWriteEntry prior to looking up the model from a reference.

Other Considerations:

TModel is an abstract base class--all the constructors are protected. Do not instantiate this class.

Member Function: TModel::AddComponent

void AddComponent (TDocumentComponent *)

Interface Category:

API.

Purpose:

Adds an embedded child component for this model. Adds the component to the tree containing this model.

Calling Context:

Called by derived classes that support embedded components.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe. Models contained in document components can be safely accessed concurrently by obtaining a TDocumentComponentReadEntry or TDocumentComponentWriteEntry prior to looking up the model from a reference.

Other Considerations:

None.

Member Function: TModel::RemoveComponent

TDocumentComponent * RemoveComponent (TDocumentComponent &)

Interface Category:

API.

Purpose:

Removes an embedded document component previously added by this model.

Calling Context:

Called by derived classes that support embedded components.

Parameters:

Return Value:

Returns the document component that was removed by this function.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe. Models contained in document components can be safely accessed concurrently by obtaining a TDocumentComponentReadEntry or TDocumentComponentWriteEntry prior to looking up the model from a reference.

Other Considerations:

None.

Member Function: TModel::IncrementTimeStamp

void IncrementTimeStamp ()

Interface Category:

API.

Purpose:

Increments the time stamp for this model. It indicates that the model has changed but does not notify clients. Do not call this function for any client visible changes. Use NotifyOfChange for those changes.

Calling Context:

Called by derived classes.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe. Models contained in document components can be safely accessed concurrently by obtaining a TDocumentComponentReadEntry or TDocumentComponentWriteEntry prior to looking up the model from a reference.

Other Considerations:

None.

Member Function: TModel::HandleLookupStyle

virtual const TModelStyle * HandleLookupStyle (const TModelStyle & patternToMatch, const TDocumentComponentReference & theChild) const

Interface Category:

API.

Purpose:

When a style is looked up on a model in a child component, it is looked up in the child component's model's attribute set. If not found and if the includeAncestors flag is true, then the model's HandleLookupStyle is called with the desired attribute and a reference to the child component. The model can delegate it to the its standard lookup or look up the attribute base on the child component reference.

Calling Context:

Called by derived classes.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe. Models contained in document components can be safely accessed concurrently by obtaining a TDocumentComponentReadEntry or TDocumentComponentWriteEntry prior to looking up the model from a reference.

Other Considerations:

None.

Member Function: TModel::HandleApplyAnchorReferenceFixups

virtual void HandleApplyAnchorReferenceFixups (TDictionaryOf < TModelAnchorReference, TModelAnchorReference >& theFixups)

Interface Category:

API.

Purpose:

Provide derived classes an opportunity to fix up any references they may have to anchors in the model. The base class fixes up all references in anchor selections and links, but no others.

Calling Context:

Called only by TModel.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe. Models contained in document components can be safely accessed concurrently by obtaining a TDocumentComponentReadEntry or TDocumentComponentWriteEntry prior to looking up the model from a reference.

Other Considerations:

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