Implements a default version of a RemapDir.
- See also:
- CloneRefHierarchy(), ReferenceTarget::Clone()
Instances of this class are used as the default argument to the
ReferenceTarget::Clone
method. When the boolean use_A_WORK2_flag is set to TRUE, the remap
directory will set this flag on all entries in the remap directory,
and will assume that any object that DOESN'T have this flag set is
not in the remap directory. This avoids the search through the
directory and speeds up things greatly. When using this feature,
you must first clear A_WORK2
on all of the objects being cloned. DS: 3/17/00. When the instance
is deleted, the Backpatch()
method is automatically called if backpatch operations were added
but never performed.
- Precondition:
- First clear the A_WORK2 flag on all objects being cloned.
- Postcondition:
- Flag is set on all entries in remap directory.
- Parameters:
-
use_A_WORK2_flag |
- used to set this flag on all entries in the remap
directory. |
This method is used to back patch the pointer for cloned
items.
If oldTarg has already been cloned, then the RefTargetHandle
variable pointed to by patchThis is set to the pointer of the
clone. If oldTarg has not been cloned, a back patch procedure is
registered that is run after all cloning is completed but before
the PostPatchProcs are run. The back patch procedure checks to see
if oldTarg has been cloned, and if so the the RefTargetHandle
variable pointed to by patchThis is set to the pointer of the
clone. If oldTarg has not been cloned, the RefTargetHandle variable
pointed to by patchThis is set to oldTarg. Because there may be a
delayed write to the RefTargetHandle variable, this variable should
not be a stack variable. Note that this method is primarily used
when an object being cloned holds a raw pointer to a
ReferenceTarget (i.e., it does not hold a reference to the
ReferenceTarget). In general, this is not safe due to the
potential for a dangling pointer when that
ReferenceTarget is deleted. It is better to use a SingleRefMaker or a
SingleWeakRefMaker member variable to hold the pointer as it will
hold a reference to the
ReferenceTarget and properly NULL the pointer when/if the
ReferenceTarget is deleted.
- See also:
- SingleRefMaker,
SingleWeakRefMaker
- Parameters:
-
patchThis |
- The RefTargetHandle variable to be set. |
oldTarg |
- The original target. |
Implements RemapDir.