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.
------------------------------------------------------------------------------
Get a FREE DOWNLOAD! and learn more about uberSVN rich system,
user administration capabilities and model configuration. Take
the hassle out of deploying and managing Subversion and the
tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users