Пример #1
0
void
ActionWarehouse::buildBuildableActions(const std::string &task)
{
  if (_syntax.isActionRequired(task) && _action_blocks[task].empty())
  {
    bool ret_value = false;
    std::pair<std::multimap<std::string, std::string>::const_iterator,
              std::multimap<std::string, std::string>::const_iterator> range = _action_factory.getActionsByTask(task);
    for (std::multimap<std::string, std::string>::const_iterator it = range.first; it != range.second; ++it)
    {
      InputParameters params = _action_factory.getValidParams(it->second);
      params.set<ActionWarehouse *>("awh") = this;

      if (params.areAllRequiredParamsValid())
      {
        params.set<std::string>("registered_identifier") = "(AutoBuilt)";
        params.set<std::string>("task") = task;
        addActionBlock(_action_factory.create(it->second, "", params));
        ret_value = true;
      }
    }

    if (!ret_value)
      _unsatisfied_dependencies.insert(task);
  }
}
Пример #2
0
void
ActionWarehouse::buildBuildableActions(const std::string & task)
{
  if (_syntax.shouldAutoBuild(task) && _action_blocks[task].empty())
  {
    bool ret_value = false;
    auto it_pair = _action_factory.getActionsByTask(task);
    for (const auto & action_pair : as_range(it_pair))
    {
      InputParameters params = _action_factory.getValidParams(action_pair.second);
      params.set<ActionWarehouse *>("awh") = this;

      if (params.areAllRequiredParamsValid())
      {
        params.set<std::string>("registered_identifier") = "(AutoBuilt)";
        addActionBlock(_action_factory.create(action_pair.second, "", params));
        ret_value = true;
      }
    }

    if (!ret_value)
      _unsatisfied_dependencies.insert(task);
  }
}