Class: TModelAnchor

Declaration: CompoundDocumentLinking.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

MCollectible

Inherited By:

TWholeModelAnchor

Purpose:

An anchor is a persistent marker of model data. It has a model selection that it uses to mark the data and it must keep the selection up-to-date with regard to editing changes.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

Classes may be derived from TModelAnchor to provide special handling of selections, such as overriding FixupSelection to perform custom fixups on lookup.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Other Considerations:

Invariants: Assert ( GetSelection() != NIL ).

Member Function: TModelAnchor::TModelAnchor

  1. TModelAnchor (const TModelSelection &)
  2. TModelAnchor (const TModelAnchor &)
  3. TModelAnchor ()

Interface Category:

API.

Purpose:

  1. Creates an anchor that has a copy of the specified model selection.
  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.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TModelAnchor::~TModelAnchor

virtual ~ TModelAnchor ()

Interface Category:

API.

Purpose:

Destructor.

Calling Context:

Called to destroy an object. You can also 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: TModelAnchor::GetReference

TModelAnchorReference GetReference () const

Interface Category:

API.

Purpose:

Returns a reference to this anchor.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns a reference to this anchor.

Exceptions:

Throws kUndefinedAnchorID if the anchor's ID is not defined.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TModelAnchor::Touch

virtual void Touch ()

Interface Category:

API.

Purpose:

Changes the anchor's modification date to the current time.

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: TModelAnchor::GetModifyDate

virtual void GetModifyDate (TTime &) const

Interface Category:

API.

Purpose:

Fills out the specified date to match the anchor's modification date.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None. The modification date is returned in the specified argument.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TModelAnchor::SetModifyDate

virtual void SetModifyDate (const TTime & theDate)

Interface Category:

API.

Purpose:

Sets the modification date of the anchor to match the specified date.

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: TModelAnchor::GetSelection

  1. TModelSelection * GetSelection ()
  2. const TModelSelection * GetSelection () const

Interface Category:

API.

Purpose:

Gets the selection that specifies the model data that the anchor is marking.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns an alias to the anchor's model selection.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TModelAnchor::SetSelection

virtual void SetSelection (const TModelSelection &)

Interface Category:

API.

Purpose:

Makes a copy of the specified selection and uses the copy to specify the data to mark.

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: TModelAnchor::AdoptSelection

virtual void AdoptSelection (TModelSelection *)

Interface Category:

API.

Purpose:

Adopts the specified selection and uses it to specify the data to mark.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws kNILSelection if theSelection ==NIL.

Concurrency:

Not multithread safe.

Other Considerations:

Preconditions: Assert ( theSelection != NIL ).

Member Function: TModelAnchor::AddAttribute

virtual void AddAttribute (const TModelAnchorAttribute & theAttribute)

Interface Category:

API.

Purpose:

Attaches a copy of the specified attribute to the model anchor.

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: TModelAnchor::DeleteAttribute

virtual void DeleteAttribute (const TModelAnchorAttribute & thePrototype)

Interface Category:

API.

Purpose:

Deletes the model anchor attribute that matches (NamesMatch() ==true) the specified attribute.

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: TModelAnchor::CopyAttribute

virtual TModelAnchorAttribute * CopyAttribute (const TModelAnchorAttribute & thePrototype) const

Interface Category:

API.

Purpose:

Copies the model anchor attribute that matches (NamesMatch() ==true) the specified attribute.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns a copy that is owned by the caller.

Exceptions:

Throws kAttributeDoesNotExist if there is no attribute that matches the pattern.

Concurrency:

Not multithread safe.

Other Considerations:

Postconditions: Assert ( thePatternToMatch.IsEqual(theFoundAttribute) ==true ).

Member Function: TModelAnchor::DeleteAllAttributes

virtual void DeleteAllAttributes ()

Interface Category:

API.

Purpose:

Removes all the anchor's attributes.

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: TModelAnchor::CopyAllAttributes

virtual void CopyAllAttributes (TCollectionOf<TModelAnchorAttribute>&) const

Interface Category:

API.

Purpose:

Fills out the specified collection with copies of all the anchor's attributes. The caller owns the collection and the copied attributes.

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: TModelAnchor::AcceptsLinks

virtual bool AcceptsLinks () const

Interface Category:

API.

Purpose:

Tests to see if the anchor allows links to be adopted into it. (That is, can this anchor be a here anchor for a link.)

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns true if the anchor allows links to be adopted into it.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TModelAnchor::AdoptLink

virtual void AdoptLink (TModelLink * aLink)

Interface Category:

API.

Purpose:

Adopts the link. The anchor will own the link object.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws kDoesNotAcceptLinks if AcceptsLinks() ==false. Throws kUndefinedAnchorID if GetReference().IsDefined() ==false. Throws kNILLink if aLink ==NIL. Throws kWrongAnchorForLink if aLink->GetHereReference() != GetReference(); Throws kLinkAlreadyInAnchor if the link is already in the anchor.

Concurrency:

Not multithread safe.

Other Considerations:

Preconditions: Assert ( AcceptsLinks() ==true ). Assert ( GetReference().IsDefined() ==true ). Assert ( aLink != NIL ). Assert ( aLink->GetHereReference() ==GetReference() ). Postconditions: Assert ( aLink->GetHereReference() ==GetReference() ). The link is in the anchor. Invariants: Assert ( GetReference().IsDefined() ==true ).

Member Function: TModelAnchor::OrphanLink

virtual TModelLink * OrphanLink (const TModelLinkReference & aLink)

Interface Category:

API.

Purpose:

Orphans the link referred to by the specified reference.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns the orphaned link.

Exceptions:

Throws kUndefinedAnchorID if GetReference().IsDefined() ==false. Throws kWrongAnchorForLink if aLink->GetHereReference() != GetReference(); Throws kLinkDoesNotExist if the link is not in the anchor.

Concurrency:

Not multithread safe.

Other Considerations:

Preconditions: Assert ( GetReference().IsDefined() ==true ). Assert ( aLink->GetHereReference() ==GetReference() ). The link is in the anchor. Postconditions: The link is not in the anchor.

Member Function: TModelAnchor::LookupLink

  1. virtual TModelLink * LookupLink (const TModelLinkReference & aLink)
  2. virtual const TModelLink * LookupLink (const TModelLinkReference & aLink) const

Interface Category:

API.

Purpose:

  1. Looks up the link referred to by the link reference.
  2. Looks up the const link referred to by the link reference.

Calling Context:

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

Parameters:

Return Value:

Returns the link that a link reference refers to.

Exceptions:

Throws kUndefinedAnchorID if GetReference().IsDefined() ==false. Throws kLinkDoesNotExist if there is no link that matches the reference.

Concurrency:

Not multithread safe.

Other Considerations:

Preconditions: Assert ( GetReference().IsDefined() ==true ). The link is not in the anchor. Postconditions: Assert (theFoundLink != NIL ).

Member Function: TModelAnchor::CreateLinkIterator

virtual TIteratorOver<TModelLink> * CreateLinkIterator () const

Interface Category:

API.

Purpose:

Creates an iterator that iterates over the anchor's links.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns an iterator.

Exceptions:

Throws kUndefinedAnchorID if GetReference().IsDefined() ==false.

Concurrency:

Not multithread safe.

Other Considerations:

Preconditions: Assert ( GetReference().IsDefined() ==true ).

Member Function: TModelAnchor::SetVisibility

virtual void SetVisibility (bool visible =true)

Interface Category:

API.

Purpose:

Sets the visibility of the anchor to match the specified Boolean value.

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: TModelAnchor::IsVisible

virtual bool IsVisible () const

Interface Category:

API.

Purpose:

Tests whether or not the anchor is visible.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns true if the anchor is visible.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TModelAnchor::operator=

TModelAnchor & operator =(const TModelAnchor &)

Interface Category:

API.

Purpose:

Assignment operator.

Calling Context:

Called when an object is assigned to another compatible object. You can also call this function directly.

Parameters:

Return Value:

Returns 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: TModelAnchor::Hash

virtual long Hash () const

Interface Category:

API.

Purpose:

Generates a hash key for use by the Collection classes.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns the hash key.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TModelAnchor::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: TModelAnchor::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: TModelAnchor::FixupSelection

virtual void FixupSelection ()

Interface Category:

API.

Purpose:

This member function is called whenever the anchor is looked up to bring the selection up to date for any editing changes performed on the model.

Calling Context:

Called by TModel::LookupAnchor.

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.