37 template <
class DerivedT>
42 explicit Predictive(
const std::vector<PredictionEngine>& engines = {}) :
43 _predictionEngines(engines)
47 const std::vector<PredictionEngine>&
50 return _predictionEngines;
55 _predictionEngines.push_back(engine);
60 this->_predictionEngines = engines;
63 std::map<MemoryID, std::vector<PredictionEngine>>
66 std::map<MemoryID, std::vector<PredictionEngine>> engines;
69 const auto& derivedThis = derived<DerivedT>(
this);
70 const auto& ownEngines = derivedThis.predictionEngines();
71 if (not ownEngines.empty())
73 engines.emplace(derivedThis.id(), derivedThis.predictionEngines());
82 std::vector<PredictionEngine> _predictionEngines;
90 template <
class DerivedT>
98 std::map<MemoryID, std::vector<PredictionEngine>>
101 std::map<MemoryID, std::vector<PredictionEngine>> engines;
104 const auto& derivedThis = derived<DerivedT>(
this);
105 derivedThis.forEachChild(
106 [&engines](
const auto& child)
108 const auto& childMap = child.getAllPredictionEngines();
109 engines.insert(childMap.begin(), childMap.end());
113 const auto& ownEngines = derivedThis.predictionEngines();
114 if (not ownEngines.empty())
116 engines.emplace(derivedThis.id(), derivedThis.predictionEngines());