Copy object data fields into subclass instance

后端 未结 2 792
执念已碎
执念已碎 2021-01-24 15:50

I have two class, TNode and TMaster. I subclassing TMaster from TNode.

The goal is to create a TMaster instance that contains all the data of a previously created TNode

2条回答
  •  再見小時候
    2021-01-24 16:18

    It should be done manually.

    Probably you want to implement something like Assign for TPersistent descendants. To make it work, you have to override Assign(To) routine, implementing deep field-by-field copying.

提交回复
热议问题