Linear Collider Forum



Home » Software Tools » LCIO » copy constructor for LCFixedObject
Re: copy constructor for LCFixedObject [message #1304 is a reply to message #1303] Tue, 20 November 2007 04:27 Go to previous messageGo to previous message
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
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic:new LCIO release v01-09
Next Topic:getEventMap(), memory consumption
Goto Forum:
  


Current Time: Sun Jul 22 07:28:32 Pacific Daylight Time 2018
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.1.
Copyright ©2001-2010 FUDforum Bulletin Board Software