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

#include <SkSLVarDeclarations.h>

Inheritance diagram for SkSL::GlobalVarDeclaration:
SkSL::ProgramElement SkSL::IRNode SkSL::Poolable

Public Member Functions

 GlobalVarDeclaration (std::unique_ptr< Statement > decl)
 
std::unique_ptr< Statement > & declaration ()
 
const std::unique_ptr< Statement > & declaration () const
 
VarDeclarationvarDeclaration ()
 
const VarDeclarationvarDeclaration () const
 
std::string description () const override
 
- Public Member Functions inherited from SkSL::ProgramElement
 ProgramElement (Position pos, Kind kind)
 
Kind kind () const
 
- 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::kGlobalVar
 

Additional Inherited Members

- Public Types inherited from SkSL::ProgramElement
using Kind = ProgramElementKind
 
- 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 variable declaration appearing at global scope. A global declaration like 'int x, y;' produces two GlobalVarDeclaration elements, each containing the declaration of one variable.

Definition at line 138 of file SkSLVarDeclarations.h.

Constructor & Destructor Documentation

◆ GlobalVarDeclaration()

SkSL::GlobalVarDeclaration::GlobalVarDeclaration ( std::unique_ptr< Statement decl)
inline

Definition at line 142 of file SkSLVarDeclarations.h.

143 : INHERITED(decl->fPosition, kIRNodeKind)
144 , fDeclaration(std::move(decl)) {
145 SkASSERT(this->declaration()->is<VarDeclaration>());
147 }
#define SkASSERT(cond)
Definition: SkAssert.h:116
static constexpr Kind kIRNodeKind
VarDeclaration & varDeclaration()
std::unique_ptr< Statement > & declaration()
Variable * var() const
void setGlobalVarDeclaration(GlobalVarDeclaration *global)

Member Function Documentation

◆ declaration() [1/2]

std::unique_ptr< Statement > & SkSL::GlobalVarDeclaration::declaration ( )
inline

Definition at line 149 of file SkSLVarDeclarations.h.

149 {
150 return fDeclaration;
151 }

◆ declaration() [2/2]

const std::unique_ptr< Statement > & SkSL::GlobalVarDeclaration::declaration ( ) const
inline

Definition at line 153 of file SkSLVarDeclarations.h.

153 {
154 return fDeclaration;
155 }

◆ description()

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

Implements SkSL::IRNode.

Definition at line 165 of file SkSLVarDeclarations.h.

165 {
166 return this->declaration()->description();
167 }

◆ varDeclaration() [1/2]

VarDeclaration & SkSL::GlobalVarDeclaration::varDeclaration ( )
inline

Definition at line 157 of file SkSLVarDeclarations.h.

157 {
158 return fDeclaration->as<VarDeclaration>();
159 }

◆ varDeclaration() [2/2]

const VarDeclaration & SkSL::GlobalVarDeclaration::varDeclaration ( ) const
inline

Definition at line 161 of file SkSLVarDeclarations.h.

161 {
162 return fDeclaration->as<VarDeclaration>();
163 }

Member Data Documentation

◆ kIRNodeKind

constexpr Kind SkSL::GlobalVarDeclaration::kIRNodeKind = Kind::kGlobalVar
inlinestaticconstexpr

Definition at line 140 of file SkSLVarDeclarations.h.


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