[Insight-developers] itk::ObjectFactoryBase::GetRegisteredFactories() returns copy of list

Ivo Wolf i.wolf at dkfz-heidelberg.de
Tue May 23 07:58:02 EDT 2006


Hi,

from the documentation of itk::ObjectFactoryBase::GetRegisteredFactories()
it seems that this method directly returns the list of registered factories
and NOT a copy of it (as it is the case in VTK). But in the current
implementation it does copy the list (what it does not copy are the
contained instances in the list):

  /** Return the list of all registered factories.  This is NOT a copy,
   * do not remove items from this list! */
  static std::list<ObjectFactoryBase*> GetRegisteredFactories();

I would expect this method to return a reference:
  static std::list<ObjectFactoryBase*>& GetRegisteredFactories();

Would there be any concerns to change this to match the documented
definition (and make it work the same way as in VTK)?

Regards,

Ivo

-- 
----------------------------------------------------------------------
Dr. Ivo Wolf, Dipl.-Phys.               Phone:  (+49) 6221/42-2327
Deutsches Krebsforschungszentrum        Fax:    (+49) 6221/42-2345
Div. Medical and Biological Informatics (E130)
Im Neuenheimer Feld 280                 email:  i.wolf at dkfz.de
D-69120 Heidelberg, Germany             http://mbi.dkfz-heidelberg.de
----------------------------------------------------------------------



More information about the Insight-developers mailing list