Skip to content
Snippets Groups Projects
Commit c15e3fc3 authored by Adam Wardynski's avatar Adam Wardynski
Browse files

Use the new cloning and clearing from Variables.

parent 7b5e7e3a
No related merge requests found
......@@ -47,7 +47,6 @@ protected:
* Represents a parsed WCCL functional operator that returns a value of given type.
* @note The class methods are not thread-safe, but you can use clone method
* to acquire a separate copy of the Operator, and the copy can be used concurrently.
* @todo need to change copying of Variables once a clone method is available for them.
*/
template <class T>
class Operator : public FunctionalOperator
......@@ -295,7 +294,7 @@ Operator<T>& Operator<T>::operator=(const Operator& other) {
BOOST_ASSERT(other.function_body_);
BOOST_ASSERT(other.variables_);
function_body_.reset(other.function_body_);
variables_.reset(new Variables(other.variables_));
variables_.reset(other.variables_->clone());
return *this;
}
......
......@@ -122,8 +122,6 @@ public:
* Also, derived classes that have clone() method copy the values
* as well, but a class may provide convenience method clone_clean()
* in case you want to get a clean state.
* @todo It needs implementing, currently it is a no-op, because
* Variables object doesn't really provide means to do it yet
*/
void clean();
......@@ -155,7 +153,7 @@ protected:
inline
ParsedExpression::ParsedExpression(const Variables &variables)
: variables_(boost::make_shared<Variables>(variables))
: variables_(variables.clone())
{
}
......@@ -204,8 +202,7 @@ void ParsedExpression::set(const std::string& var_name, const T& value) {
inline
void ParsedExpression::clean()
{
//TODO - imlement this. The Variables object doesn't really
//provide a way to do that atm so it should be changed
variables_->reset_values();
}
inline
......
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