DeepCopy Method

WRAPPER_API static void DeepCopy([Type] &leftSide, const [Type] &rightSide)

WRAPPER_API void DeepCopy(const [Type] &value)

 

Above, [Type] is a placeholder for the class name of the object to be copied.

 

Description

The DeepCopy method is a member of many classes in GeoCalc.  It produces a deep-copy of the specified object.  A deep-copy is one in which all member objects are cloned so that they are distinct from the members of the original object.  In contrast, a shallow-copy is one in which the references to member objects are copied so that the copy has the same members as the original.  

There are two signatures for this method.  The first one takes a single argument which is the object to be copied.  The argument must have the same type as the current instance, because the resulting copy is stored in the current instance.  The second signature takes two arguments of the same type.  The first argument is the object that will be filled with values copied from the second argument, which is the original.  

The following example shows the use of the DeepCopy method for the AngularUnit object, but the usage is the same for all objects.

 

Example

void DeepCopy(GEOCALCPBW_NAMESPACE::AngularUnit * au1, GEOCALCPBW_NAMESPACE::AngularUnit * au2)

{

GEOCALCPBW_NAMESPACE::AngularUnit::DeepCopy(*au1, *au2);

// or

au1->DeepCopy(*au2);

}