Re: copy constructor for LCFixedObject [message #1304 is a reply to message #1303] |
Tue, 20 November 2007 04:27   |
killenberg Messages: 125 Registered: July 2005 Location: CERN |
|
|
|
Hello Frank,
we want to store the object in a vector, and this uses the copy constructor. So the clone solution does not work.
In this case it is very obvious how the copy constructor should look like. The LCFixedObject is not even derived from LCObject, so I think it can be treated differently. It can create it's own instance of a LCGenericObject, and deletes it in the constructor. It knows about the ownership because of the _createdObject flag. So the copy constructor knows when to copy the object and when not to.
As there is no clone-method we currently have to use the copy constructor. But in my opinion the copy constructor of the FixedObject would be the place to use the clone-method of the GenericObject.
Cheers
Martin
Martin Killenberg
CERN
martin.killenberg@cern.ch
|
|
|