@@ -49,7 +49,7 @@ using operators::Operator;
4949using actions::Action;
5050using variables::Variable;
5151using actions::transformations::None;
52-
52+ using actions::transformations::Transformation;
5353
5454Rule::Rule (const std::string &marker)
5555 : m_theDisruptiveAction(nullptr ),
@@ -326,11 +326,11 @@ bool Rule::executeOperatorAt(Transaction *trans, const std::string &key,
326326}
327327
328328
329- inline void Rule::executeTransformation (actions::Action *a,
329+ inline void Rule::executeTransformation (
330+ actions::transformations::Transformation *a,
330331 std::shared_ptr<std::string> *value,
331332 Transaction *trans,
332- std::list<std::pair<std::shared_ptr<std::string>,
333- std::shared_ptr<std::string>>> *ret,
333+ TransformationResults *ret,
334334 std::string *path,
335335 int *nth) const {
336336
@@ -359,15 +359,11 @@ inline void Rule::executeTransformation(actions::Action *a,
359359}
360360
361361
362- std::list<std::pair<std::shared_ptr<std::string>,
363- std::shared_ptr<std::string>>>
364- Rule::executeDefaultTransformations (
365- Transaction *trans, const std::string &in) {
362+ void Rule::executeTransformations (
363+ Transaction *trans, const std::string &in, TransformationResults &ret) {
366364 int none = 0 ;
367365 int transformations = 0 ;
368366 std::string path (" " );
369- std::list<std::pair<std::shared_ptr<std::string>,
370- std::shared_ptr<std::string>>> ret;
371367 std::shared_ptr<std::string> value =
372368 std::shared_ptr<std::string>(new std::string (in));
373369
@@ -394,14 +390,17 @@ std::list<std::pair<std::shared_ptr<std::string>,
394390 continue ;
395391 }
396392
397- executeTransformation (a.get (), &value, trans, &ret, &path,
393+ // FIXME: here the object needs to be a transformation already.
394+ Transformation *t = dynamic_cast <Transformation *>(a.get ());
395+ executeTransformation (t, &value, trans, &ret, &path,
398396 &transformations);
399397 }
400398 }
401399
402400 for (Action *a : this ->m_actionsRuntimePre ) {
403401 if (none == 0 ) {
404- executeTransformation (a, &value, trans, &ret, &path,
402+ Transformation *t = dynamic_cast <Transformation *>(a);
403+ executeTransformation (t, &value, trans, &ret, &path,
405404 &transformations);
406405 }
407406 if (a->m_isNone ) {
@@ -427,7 +426,8 @@ std::list<std::pair<std::shared_ptr<std::string>,
427426 }
428427 actions::Action *a = dynamic_cast <actions::Action*>(b.second .get ());
429428 if (none == 0 ) {
430- executeTransformation (a, &value, trans, &ret, &path,
429+ Transformation *t = dynamic_cast <Transformation *>(a);
430+ executeTransformation (t, &value, trans, &ret, &path,
431431 &transformations);
432432 }
433433 if (a->m_isNone ) {
@@ -446,8 +446,6 @@ std::list<std::pair<std::shared_ptr<std::string>,
446446 std::shared_ptr<std::string>(new std::string (*value)),
447447 std::shared_ptr<std::string>(new std::string (path))));
448448 }
449-
450- return ret;
451449}
452450
453451
@@ -711,10 +709,9 @@ bool Rule::evaluate(Transaction *trans,
711709 continue ;
712710 }
713711
714- std::list<std::pair<std::shared_ptr<std::string>,
715- std::shared_ptr<std::string>>> values;
712+ TransformationResults values;
716713
717- values = executeDefaultTransformations (trans, value);
714+ executeTransformations (trans, value, values );
718715
719716 for (const auto &valueTemp : values) {
720717 bool ret;
0 commit comments