QList<ParameterizedCommand::Pointer> ParameterizedCommand::GenerateCombinations(const SmartPointer<Command> command) { QList<IParameter::Pointer> parameters(command->GetParameters()); typedef QList<QList<Parameterization> > ExpandedParamsType; const ExpandedParamsType expansion(ExpandParameters(0, parameters)); QList<ParameterizedCommand::Pointer> combinations; for (ExpandedParamsType::const_iterator expansionItr = expansion.begin(); expansionItr != expansion.end(); ++expansionItr) { QList<Parameterization> combination(*expansionItr); QList<Parameterization> parameterizations(combination); ParameterizedCommand::Pointer pCmd(new ParameterizedCommand(command, parameterizations)); combinations.push_back(pCmd); } return combinations; }
std::vector<ParameterizedCommand::Pointer> ParameterizedCommand::GenerateCombinations(const SmartPointer<Command> command) throw(NotDefinedException) { std::vector<IParameter::Pointer> parameters(command->GetParameters()); typedef std::vector<std::list<Parameterization> > ExpandedParamsType; const ExpandedParamsType expansion(ExpandParameters(0, parameters)); std::vector<ParameterizedCommand::Pointer> combinations; for (ExpandedParamsType::const_iterator expansionItr = expansion.begin(); expansionItr != expansion.end(); ++expansionItr) { std::list<Parameterization> combination(*expansionItr); std::vector<Parameterization> parameterizations(combination.begin(), combination.end()); ParameterizedCommand::Pointer pCmd(new ParameterizedCommand(command, parameterizations)); combinations.push_back(pCmd); } return combinations; }