Flutter Engine
The Flutter Engine
Public Member Functions | Static Public Attributes | List of all members
SkSL::FieldSymbol Class Referencefinal

#include <SkSLFieldSymbol.h>

Inheritance diagram for SkSL::FieldSymbol:
SkSL::Symbol SkSL::IRNode SkSL::Poolable

Public Member Functions

 FieldSymbol (Position pos, const Variable *owner, int fieldIndex)
 
int fieldIndex () const
 
const Variableowner () const
 
std::string description () const override
 
- Public Member Functions inherited from SkSL::Symbol
 Symbol (Position pos, Kind kind, std::string_view name, const Type *type=nullptr)
 
 ~Symbol () override
 
std::unique_ptr< Expressioninstantiate (const Context &context, Position pos) const
 
const Typetype () const
 
Kind kind () const
 
std::string_view name () const
 
void setName (std::string_view newName)
 
- Public Member Functions inherited from SkSL::IRNode
virtual ~IRNode ()
 
virtual std::string description () const =0
 
 IRNode (const IRNode &)=delete
 
IRNodeoperator= (const IRNode &)=delete
 
Position position () const
 
void setPosition (Position p)
 
template<typename T >
bool is () const
 
template<typename T >
const Tas () const
 
template<typename T >
Tas ()
 

Static Public Attributes

static constexpr Kind kIRNodeKind = Kind::kField
 

Additional Inherited Members

- Public Types inherited from SkSL::Symbol
using Kind = SymbolKind
 
- Static Public Member Functions inherited from SkSL::Poolable
static void * operator new (const size_t size)
 
static void operator delete (void *ptr)
 
- Public Attributes inherited from SkSL::IRNode
Position fPosition
 
- Protected Member Functions inherited from SkSL::IRNode
 IRNode (Position position, int kind)
 
- Protected Attributes inherited from SkSL::IRNode
int fKind
 

Detailed Description

A symbol which should be interpreted as a field access. Fields are added to the symboltable whenever a bare reference to an identifier should refer to a struct field; in GLSL, this is the result of declaring anonymous interface blocks.

Definition at line 23 of file SkSLFieldSymbol.h.

Constructor & Destructor Documentation

◆ FieldSymbol()

SkSL::FieldSymbol::FieldSymbol ( Position  pos,
const Variable owner,
int  fieldIndex 
)
inline

Definition at line 27 of file SkSLFieldSymbol.h.

28 : INHERITED(pos, kIRNodeKind, owner->type().fields()[fieldIndex].fName,
29 owner->type().fields()[fieldIndex].fType)
30 , fOwner(owner)
31 , fFieldIndex(fieldIndex) {}
SkPoint pos
static constexpr Kind kIRNodeKind
const Variable & owner() const
int fieldIndex() const
const Type & type() const
Definition: SkSLSymbol.h:42
virtual SkSpan< const Field > fields() const
Definition: SkSLType.h:469

Member Function Documentation

◆ description()

std::string SkSL::FieldSymbol::description ( ) const
inlineoverridevirtual

Implements SkSL::IRNode.

Definition at line 41 of file SkSLFieldSymbol.h.

41 {
42 return this->owner().name().empty()
43 ? std::string(this->name())
44 : (this->owner().description() + "." + std::string(this->name()));
45 }
std::string description() const override
std::string_view name() const
Definition: SkSLSymbol.h:51
Definition: ref_ptr.h:256

◆ fieldIndex()

int SkSL::FieldSymbol::fieldIndex ( ) const
inline

Definition at line 33 of file SkSLFieldSymbol.h.

33 {
34 return fFieldIndex;
35 }

◆ owner()

const Variable & SkSL::FieldSymbol::owner ( ) const
inline

Definition at line 37 of file SkSLFieldSymbol.h.

37 {
38 return *fOwner;
39 }

Member Data Documentation

◆ kIRNodeKind

constexpr Kind SkSL::FieldSymbol::kIRNodeKind = Kind::kField
inlinestaticconstexpr

Definition at line 25 of file SkSLFieldSymbol.h.


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