MantisBT - JANA
View Issue Details
0000359JANAFeature Requestpublic2013-06-24 13:332013-12-13 17:00
davidl 
davidl 
normalminorN/A
resolvedfixed 
0000359: Add CopyTo method to JFactory_base
Several instances have occurred where it would be very convenient to be able to copy pointers to externally produced objects into a factory using only the JFactory_base pointer and not the templated JFactory<> pointer. This happens in event sources where several types of objects may be produced but it's not convenient to list al types od data at multiple places in the code.

The CopyTo method should probably take a vector<JObject*> reference and be virtual so that the JFactory<T> method can do the appropriate dynamic_cast before storing it in the factory's _data vector.

It may also be handy to have a templated method of JFactory_base that can take vector<T*>& that it can then use to try and dynamic_cast itself into JFactory<T> and then call the old CopyTo method. (There may be some issues with plugins here so thorough testing will be required.)
No tags attached.
Issue History
2013-06-24 13:33davidlNew Issue
2013-12-13 17:00davidlNote Added: 0000582
2013-12-13 17:00davidlStatusnew => resolved
2013-12-13 17:00davidlResolutionopen => fixed
2013-12-13 17:00davidlAssigned To => davidl

Notes
(0000582)
davidl   
2013-12-13 17:00   
Added a CopyTo method to JFactory_base and corresponding one to JFactory. The second suggestion was not implemented. Note that only a compilation test was done here. No testing was done.

This change will appear in JANA 0.7.0