Taxonomy Categories:
Member Functions:
Interface Category:
API.
Inherits From:
TCommandRequiringDataFixup
Inherited By:
TPullDataCommand
TPushDataCommand
Purpose:
This command replaces selected data with new data contained in a model. The command supports undo and redo.
Instantiation:
Allocate on the heap or the stack.
Deriving Classes:
No special requirements.
Concurrency:
Not multithread safe.
Resource Use:
No special requirements.
Invariants:
Assert (GetModel() != NIL)
- TReplaceDataCommand (TModel * modelToAdopt)
- TReplaceDataCommand (const TReplaceDataCommand &)
- TReplaceDataCommand ()
Interface Category:
API.
Purpose:
- Constructs a command with model to use to replace data.
- Copy constructor.
- Default constructor.
Calling Context:
- Construct command data to be absorbed into target.
- Called to copy an object.
- Called by the stream-in operators.
Parameters:
- TModel * modelToAdopt -The model to adopt to be used to replace data.
- const TReplaceDataCommand & -The command to copy.
- Takes no parameters.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
TReplaceDataCommand & operator =(const TReplaceDataCommand &)
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.
virtual ~ TReplaceDataCommand ()
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.
virtual TStream & operator >>=(TStream &) const
Interface Category:
API.
Purpose:
Stream-out operator.
Calling Context:
Called to stream out data.
Parameters:
- TStream & -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.
virtual TStream & operator <<= (TStream &)
Interface Category:
API.
Purpose:
Stream-in operator.
Calling Context:
Called to stream in data.
Parameters:
- TStream & -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.
virtual void HandleDoBegin (MDataExchanger &)
Interface Category:
API.
Purpose:
Replaces the data selected by the target selection with the model in this command.
Calling Context:
Called by TCommandOn.
Parameters:
- MDataExchanger & -The target selection used for the replace data. The command calls ReplaceData on the selection.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
This function is protected.
virtual void HandleUndo (MDataExchanger &)
Interface Category:
API.
Purpose:
Undoes the replacement of data in the selection. The data returned from the replace is passed back to the selection for undo.
Calling Context:
Called by TCommandOn.
Parameters:
- MDataExchanger & -The target selection used to undo the replace. The command calls UndoReplaceData with the model returned from the previous call to ReplaceData.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
This function is protected.
virtual void HandleRedo (MDataExchanger &)
Interface Category:
API.
Purpose:
Redoes the command. The data returned from the previous undo replace is passed back to the selection for redo.
Calling Context:
Called by TCommandOn.
Parameters:
- MDataExchanger & -The target selection used to redo the replace. The command calls RedoReplaceData with the model returned from the previous call to UndoReplaceData.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
This function is protected.
virtual void HandleCommitDone ()
Interface Category:
API.
Purpose:
Commits the command to a done state. The storage for the model owned by the command is deleted because the model will never be used again.
Calling Context:
Called by TCommandOn.
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.