| 4052 | } // KnobHelper::refreshListenersAfterValueChange |
| 4053 | |
| 4054 | void |
| 4055 | KnobHelper::cloneExpressions(KnobI* other, |
| 4056 | int dimension, |
| 4057 | int otherDimension) |
| 4058 | { |
| 4059 | assert( (int)_imp->expressions.size() == getDimension() ); |
| 4060 | assert( (dimension == otherDimension) || (dimension != -1) ); |
| 4061 | try { |
| 4062 | if (dimension == -1) { |
| 4063 | int dims = std::min( getDimension(), other->getDimension() ); |
| 4064 | for (int i = 0; i < dims; ++i) { |
| 4065 | std::string expr = other->getExpression(i); |
| 4066 | bool hasRet = other->isExpressionUsingRetVariable(i); |
| 4067 | if ( !expr.empty() ) { |
| 4068 | setExpression(i, expr, hasRet, false); |
| 4069 | cloneExpressionsResults(other, i, i); |
| 4070 | } |
| 4071 | } |
| 4072 | } else { |
| 4073 | if (otherDimension == -1) { |
| 4074 | otherDimension = dimension; |
| 4075 | } |
| 4076 | assert( dimension >= 0 && dimension < getDimension() && |
| 4077 | otherDimension >= 0 && otherDimension < other->getDimension() ); |
| 4078 | std::string expr = other->getExpression(otherDimension); |
| 4079 | bool hasRet = other->isExpressionUsingRetVariable(otherDimension); |
| 4080 | if ( !expr.empty() ) { |
| 4081 | setExpression(dimension, expr, hasRet, false); |
| 4082 | cloneExpressionsResults(other, dimension, otherDimension); |
| 4083 | } |
| 4084 | } |
| 4085 | } catch (...) { |
| 4086 | ///ignore errors |
| 4087 | } |
| 4088 | } |
| 4089 | |
| 4090 | bool |
| 4091 | KnobHelper::cloneExpressionsAndCheckIfChanged(KnobI* other, |
nothing calls this directly
no test coverage detected