Commit 7fe9fe02 authored by Janik Zikovsky's avatar Janik Zikovsky
Browse files

Refs #2934: PeaksWorkspace: expose to IPropertyManager.

parent 421c4a29
......@@ -223,8 +223,11 @@ namespace DataObjects
};
/// Typedef for a shared pointer to a peaks workspace.
typedef boost::shared_ptr<PeaksWorkspace> PeaksWorkspace_sptr;
/// Typedef for a shared pointer to a peaks workspace.
typedef boost::shared_ptr<PeaksWorkspace> PeaksWorkspace_sptr;
/// Typedef for a shared pointer to a const peaks workspace.
typedef boost::shared_ptr<const PeaksWorkspace> PeaksWorkspace_const_sptr;
}
}
......
......@@ -479,3 +479,47 @@ namespace DataObjects
}
}
///\cond TEMPLATE
namespace Mantid
{
namespace Kernel
{
template<> DLLExport
Mantid::DataObjects::PeaksWorkspace_sptr IPropertyManager::getValue<Mantid::DataObjects::PeaksWorkspace_sptr>(const std::string &name) const
{
PropertyWithValue<Mantid::DataObjects::PeaksWorkspace_sptr>* prop =
dynamic_cast<PropertyWithValue<Mantid::DataObjects::PeaksWorkspace_sptr>*>(getPointerToProperty(name));
if (prop)
{
return *prop;
}
else
{
std::string message = "Attempt to assign property "+ name +" to incorrect type. Expected PeaksWorkspace.";
throw std::runtime_error(message);
}
}
template<> DLLExport
Mantid::DataObjects::PeaksWorkspace_const_sptr IPropertyManager::getValue<Mantid::DataObjects::PeaksWorkspace_const_sptr>(const std::string &name) const
{
PropertyWithValue<Mantid::DataObjects::PeaksWorkspace_sptr>* prop =
dynamic_cast<PropertyWithValue<Mantid::DataObjects::PeaksWorkspace_sptr>*>(getPointerToProperty(name));
if (prop)
{
return prop->operator()();
}
else
{
std::string message = "Attempt to assign property "+ name +" to incorrect type. Expected const PeaksWorkspace.";
throw std::runtime_error(message);
}
}
} // namespace Kernel
} // namespace Mantid
///\endcond TEMPLATE
......@@ -96,7 +96,7 @@ namespace MDEvents
void MDEWPeakIntegration::exec()
{
inWS = getProperty("InputWorkspace");
// peakWS = getProperty("PeaksWorkspace");
peakWS = getProperty("PeaksWorkspace");
CALL_MDEVENT_FUNCTION(this->integrate, inWS);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment