[great-users] Udm CopyObjectHierarchy function duration increases during transformation

Belschner, Tim tim.belschner at ils.uni-stuttgart.de
Thu Sep 14 06:48:49 CDT 2017


Hello  everybody,

based on the generated code for the GReAT Group operator, we built up a cpp template for copying an abstract source object including its children. Since we would like to pass the copied object to an out-port within the same rule, the approach is to create a dummy object within the rule's effector and replace it during the AttributeMapping by calling the aforementioned template:

//++++++++++++++++++++++++++
template <class T1, class T2, class T3 > bool UserLibCloneObjectAbstractSource( T1& fromObj, T2& toObj, T3& toParent)
{
                T1 newObj= T1::Create( toParent );

                UdmUtil::copy_assoc_map copy_map;
                UdmUtil::CopyObjectHierarchy(fromObj.__impl(), newObj.__impl(), newObj.__impl()->__getdn(), copy_map);

                toObj.DeleteObject();
                toObj = newObj;

                return true;
}
// ++++++++++++++++++++++++++

The result in the transformation's output is as intended. But, the runtime of the function UdmUtil::CopyObjectHierarchy within the template increases with every call. After several calls, the execution of UdmUtil::CopyObjectHierarchy takes several seconds. My search within the Udm source code did not reveal any reason. This is why I would like to ask if someone could give me a hint or provide an alternative solution? For example an incorrect usage of the UdmUtil::copy_assoc_map.

An example transformation with the necessary metamodel and inputs can be found here: https://belschner.org/nextcloud/index.php/s/RiMjSyd2yHKFYdT  PW: GReAT123!
The cpp template is located in the "UserLib_CloneObject.h". The increasing runtime for a single "CopyObjectHierarchy" execution can be seen in the console output (Steps 2 to 3).

Thanks in advance and best regards

Tim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.isis.vanderbilt.edu/pipermail/great-users/attachments/20170914/230270ec/attachment.html>


More information about the great-users mailing list