Hi David,
thanks a lot for your suggestions. I filed bug report #9211 and we will
discuss the issue on our next meeting.
Thanks,
Sascha
On 08/19/2011 08:17 PM, Guthrie, David A wrote:
> In mitkDataNode, there is the function
>
> #ifndef _MSC_VER
> template<typename T>
> bool mitk::DataNode::GetPropertyValue(const char* propertyKey, T& value,
> mitk::BaseRenderer* renderer) const
> {
> GenericProperty<T>* gp=
> dynamic_cast<GenericProperty<T>*>(GetProperty(propertyKey, renderer) );
> if ( gp != NULL )
> {
> value = gp->GetValue();
> return true;
> }
> return false;
> }
>
> template bool mitk::DataNode::GetPropertyValue<double>(char const*, double&,
> mitk::BaseRenderer*) const;
> template bool mitk::DataNode::GetPropertyValue<float>(char const*, float&,
> mitk::BaseRenderer*) const;
> template bool mitk::DataNode::GetPropertyValue<int>(char const*, int&,
> mitk::BaseRenderer*) const;
> template bool mitk::DataNode::GetPropertyValue<bool>(char const*, bool&,
> mitk::BaseRenderer*) const;
>
> #endif
>
> The function is implemented in the header for msvc, but in the cpp otherwise.
> Then it is followed in the cpp by the 4 instantiations. The problem with
> this is that std::string works just fine if you call GetPropertyValue on msvc
> since the template is implemented in the header and the string property is a
> GenericProperty<std::string> but it doesn't work on g++.
>
> It seems to my that it would be fine to just put the whole function in the
> header all the time to make it work consistently. Otherwise, you could add
>
> template bool mitk::DataNode::GetPropertyValue<std::string>(char const*,
> std::string&, mitk::BaseRenderer*) const;
>
> to the file.
>
> I know GetStringProperty works the same way, I was just hoping to make it
> more consistent.
------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users