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 ).
- TModelAnchor (const TModelSelection &)
- TModelAnchor (const TModelAnchor &)
- TModelAnchor ()
Interface Category:
API.
Purpose:
- Creates an anchor that has a copy of the specified model selection.
- Copy constructor.
- Default constructor.
Calling Context:
- Call this function directly.
- Called to copy an object.
- Called by the stream-in operators.
Parameters:
- const TModelSelection & -The model selection that specifies the model data to mark.
- const TModelAnchor & -The anchor to copy.
- Takes no parameters.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
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.
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:
- TTime & -The return value for the modification date.
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:
- const TTime & theDate -The new modification date.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
Member Function: TModelAnchor::GetSelection
- TModelSelection * GetSelection ()
- 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:
- const TModelAnchorAttribute & theAttribute -The attribute to add.
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:
- const TModelAnchorAttribute & thePrototype -The attribute to delete.
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:
- const TModelAnchorAttribute & thePrototype -The attribute to copy.
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:
- TCollectionOf<TModelAnchorAttribute> & -A collection to receive copies of all the anchor's attributes.
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
- virtual TModelLink * LookupLink (const TModelLinkReference & aLink)
- virtual const TModelLink * LookupLink (const TModelLinkReference & aLink) const
Interface Category:
API.
Purpose:
- Looks up the link referred to by the link reference.
- Looks up the const link referred to by the link reference.
Calling Context:
- Call this function directly.
- 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:
- bool visible =true -The visibility to set.
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.
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:
- TStream & towhere -The stream to which the object streams itself out.
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:
- TStream & fromwhere -The stream from which the object streams itself in.
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.