[Insight-developers] itkObjectFactoryBase class variables seen as harmful?

Williams, Norman K norman-k-williams at uiowa.edu
Wed Mar 23 12:28:24 EDT 2011


I have a topic with a 'fix' for this.

http://review.source.kitware.com/#change,1244


As I said in a previous message, I ran into inexplicable behavior trying
to add a TransformIO class -- itk::TransformIOBase was unable to create
Transforms, because the TransformFactories registered to do so didn't
appear to be in ObjectFactoryBase's m_RegisteredFactories list which was a
static member of itk::ObjectFactoryBase.

In testing to try and figure out why, it seemed as though even though
ObjectFactoryBase was supposedly a singleton class, there was more than
one m_RegisteredFactories static member -- printing out its address and
value showed that there was a different m_RegisteredFactories for the
ImageIOFactory, TransformFactory, and TransformIOFactory.

This sure didn't seem to be what was intended, and I don't understand why
it's the case. It may well be a peculiarity of OS X linking -- I haven't
tried this on Linux or Windows.

But at least on OS X, the above patch fixes things.  Is there any reason
the registered factories list needs to be a static member variable?



________________________________
Notice: This UI Health Care e-mail (including attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and may be legally privileged.  If you are not the intended recipient, you are hereby notified that any retention, dissemination, distribution, or copying of this communication is strictly prohibited.  Please reply to the sender that you have received the message in error, then delete it.  Thank you.
________________________________


More information about the Insight-developers mailing list