Ticket #11408 (assigned)
Const correctness for Workspaces
Reported by: | Owen Arnold | Owned by: | Owen Arnold |
---|---|---|---|
Priority: | major | Milestone: | Backlog |
Component: | Framework | Keywords: | |
Cc: | Blocked By: | ||
Blocking: | Tester: |
Description
I cannot do this inside the execute method of my algorithm.
boost::shared_ptr<const T> prop = this->getProperty("InputWorkspace");
I can only do this
boost::shared_ptr<T> prop = this->getProperty("InputWorkspace");
This is bad because If I have an InputWorkspace as Kernel::Direction.In (not Direction.InOut) I do not, and should not be given the ability to modify that Workspace.
The problem is in IPropertyManager TypedValue.
It should just be a case of introducing this to get things working.
/// explicit specialization for boost::shared_const_ptr template <typename T> operator boost::shared_ptr<const T>() { return pm.getValue<boost::shared_ptr<T>>(prop); }
Change History
Note: See
TracTickets for help on using
tickets.