ΒΆtemplate <typename RuleType,
          typename... RequirementTypes>
std::unique_ptr<RefactoringActionRule>
createRefactoringActionRule(
    const RequirementTypes&... Requirements)

Description

Creates a new refactoring action rule that constructs and invokes the\c RuleType rule when all of the requirements are satisfied. This function takes in a list of values whose type derives from\c RefactoringActionRuleRequirement. These values describe the initiation requirements that have to be satisfied by the refactoring engine before the provided action rule can be constructed and invoked. The engine verifies that the requirements are satisfied by evaluating them (using the 'evaluate' member function) and checking that the results don't contain any errors. Once all requirements are satisfied, the provided refactoring rule is constructed by passing in the values returned by the requirements' evaluate functions as arguments to the constructor. The rule is then invoked immediately after construction. The separation of requirements, their evaluation and the invocation of the refactoring action rule allows the refactoring clients to: - Disable refactoring action rules whose requirements are not supported. - Gather the set of options and define a command-line / visual interface that allows users to input these options without ever invoking the action.

Declared at: clang/include/clang/Tooling/Refactoring/RefactoringActionRulesInternal.h:118

Templates

RuleType
RequirementTypes

Parameters

const RequirementTypes&... Requirements