clang  9.0.0
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
clang::tooling::StencilPartInterface Class Referenceabstract

A stencil is represented as a sequence of "parts" that can each individually generate a code string based on a match result. More...

#include "clang/Tooling/Refactoring/Stencil.h"

Inheritance diagram for clang::tooling::StencilPartInterface:
[legend]
Collaboration diagram for clang::tooling::StencilPartInterface:
[legend]

Public Member Functions

virtual ~StencilPartInterface ()=default
 
virtual llvm::Error eval (const ast_matchers::MatchFinder::MatchResult &Match, std::string *Result) const =0
 Evaluates this part to a string and appends it to Result. More...
 
virtual bool isEqual (const StencilPartInterface &other) const =0
 
const void * typeId () const
 

Protected Member Functions

 StencilPartInterface (const void *DerivedId)
 
 StencilPartInterface (const StencilPartInterface &)=default
 
StencilPartInterfaceoperator= (const StencilPartInterface &)=default
 

Protected Attributes

const void * TypeId
 Unique identifier of the concrete type of this instance. More...
 

Detailed Description

A stencil is represented as a sequence of "parts" that can each individually generate a code string based on a match result.

The different kinds of parts include (raw) text, references to bound nodes and assorted operations on bound nodes.

Users can create custom Stencil operations by implementing this interface.

Definition at line 41 of file Stencil.h.

Constructor & Destructor Documentation

◆ ~StencilPartInterface()

virtual clang::tooling::StencilPartInterface::~StencilPartInterface ( )
virtualdefault

◆ StencilPartInterface() [1/2]

clang::tooling::StencilPartInterface::StencilPartInterface ( const void *  DerivedId)
inlineprotected

Definition at line 55 of file Stencil.h.

References operator=().

◆ StencilPartInterface() [2/2]

clang::tooling::StencilPartInterface::StencilPartInterface ( const StencilPartInterface )
protecteddefault

Member Function Documentation

◆ eval()

virtual llvm::Error clang::tooling::StencilPartInterface::eval ( const ast_matchers::MatchFinder::MatchResult Match,
std::string *  Result 
) const
pure virtual

Evaluates this part to a string and appends it to Result.

Result is undefined in the case of an error.

Referenced by clang::tooling::Stencil::operator()().

◆ isEqual()

virtual bool clang::tooling::StencilPartInterface::isEqual ( const StencilPartInterface other) const
pure virtual

Implemented in StencilPartImpl< T >.

◆ operator=()

StencilPartInterface& clang::tooling::StencilPartInterface::operator= ( const StencilPartInterface )
protecteddefault

Referenced by StencilPartInterface().

◆ typeId()

const void* clang::tooling::StencilPartInterface::typeId ( ) const
inline

Definition at line 52 of file Stencil.h.

References TypeId.

Referenced by down_cast().

Member Data Documentation

◆ TypeId

const void* clang::tooling::StencilPartInterface::TypeId
protected

Unique identifier of the concrete type of this instance.

Supports safe downcasting.

Definition at line 64 of file Stencil.h.

Referenced by typeId().


The documentation for this class was generated from the following file: