TStructure.Clone()

Info about design forms features
PetrS
Site Admin
Posts: 181
Joined: 11 Jul 2014, 13:55

TStructure.Clone()

Postby PetrS » 16 Jul 2014, 06:22

bTStructure.Clone() function/b
Version: 0.1.28 and higher

Clone function returns ideep copy/i of the structure.
Cloned structure can not contain any objects. It can consist just from numbers, booleans, strings, other structures or arrays (lists).

ubWarning:/b/u :!:
Be extremely careful using this function. If the structure contains loop (structure contains reference to itself), the function throws an StackOverflowException and application fails!

ubExplanation of shallow x deep copy:/b/u
Deep copy is creating a new object and then copying all the properties of the current object to the new object. If a property is a value type --> a bit-by-bit copy of the property is performed. If a property is a reference type --> a new copy (clone) of the referred object is performed.

Shallow copying is creating a new object and then copying all the properties of the current object to the new object. If a property is a value type --> a bit-by-bit copy of the property is performed. If a property is a reference type --> the reference is copied but the referred object is not(!); therefore the original object and its clone refer to the same object!
Ing. Petr Slepicka
DesignForms Online
Engineering calculations online - EuroCode, AISC, statics
Automate your static calculations today!

Return to “Design forms features”

Who is online

Users browsing this forum: No registered users and 2 guests