Loading...
Searching...
No Matches
VariableNode Class Reference

Abstract syntax tree node representing a raw variable reference, i.e. More...

#include <variableExpressionAST.h>

+ Inheritance diagram for VariableNode:

Public Member Functions

Variable Name
const std::string & GetName () const
 
void SetName (const std::string &name)
 
Fallback Value
Node * GetFallbackValue ()
 Returns the fallback value for this variable.
 
const Node * GetFallbackValue () const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
SDF_API void SetFallbackValue (const Node &node)
 Sets the fallback value for this node.
 
void ClearFallbackValue ()
 Clears any set fallback value.
 
- Public Member Functions inherited from Node
SDF_API std::unique_ptr< Node > Clone () const
 
SDF_API SdfVariableExpression GetExpression () const
 Return SdfVariableExpression for this node.
 
SDF_API SdfVariableExpression::Builder GetExpressionBuilder () const
 Return SdfVariableExpression::Builder for this node.
 
template<class T >
T * As ()
 
template<class T >
const T * As () const
 

Friends

class _NodeCreator
 

Additional Inherited Members

- Protected Member Functions inherited from Node

Detailed Description

Abstract syntax tree node representing a raw variable reference, i.e.

${FOO}. Variables may also have a fallback value. When evaluating a variable, if a fallback value is specified, it will be returned if the variable is not defined in the current context.

This does not include variable references within quoted strings, i.e. "FOO_${BAR}". See LiteralNode.

Definition at line 167 of file variableExpressionAST.h.

Member Function Documentation

◆ ClearFallbackValue()

void ClearFallbackValue ( )
inline

Clears any set fallback value.

Definition at line 193 of file variableExpressionAST.h.

◆ GetFallbackValue() [1/2]

Node * GetFallbackValue ( )
inline

Returns the fallback value for this variable.

If no fallback value is set, this value will be nullptr.

Definition at line 182 of file variableExpressionAST.h.

◆ GetFallbackValue() [2/2]

const Node * GetFallbackValue ( ) const
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 185 of file variableExpressionAST.h.

◆ GetName()

const std::string & GetName ( ) const
inline

Definition at line 173 of file variableExpressionAST.h.

◆ SetFallbackValue()

SDF_API void SetFallbackValue ( const Node & node)

Sets the fallback value for this node.

node must be a LiteralNode or a ListNode. If node is not one of the allowed types a coding error will be emitted and no changes will be made.

◆ SetName()

void SetName ( const std::string & name)
inline

Definition at line 174 of file variableExpressionAST.h.

Friends And Related Symbol Documentation

◆ _NodeCreator

friend class _NodeCreator
friend

Definition at line 197 of file variableExpressionAST.h.


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