KiCad PCB EDA Suite
PCB_EXPR_TYPE_REF Class Reference

#include <pcb_expr_evaluator.h>

Inheritance diagram for PCB_EXPR_TYPE_REF:
PCB_EXPR_VAR_REF LIBEVAL::VAR_REF

Public Member Functions

 PCB_EXPR_TYPE_REF (int aItemIndex)
 
LIBEVAL::VALUEGetValue (LIBEVAL::CONTEXT *aCtx) override
 
void SetIsEnum (bool s)
 
bool IsEnum () const
 
void SetType (LIBEVAL::VAR_TYPE_T type)
 
LIBEVAL::VAR_TYPE_T GetType () const override
 
void AddAllowedClass (TYPE_ID type_hash, PROPERTY_BASE *prop)
 
BOARD_ITEMGetObject (const LIBEVAL::CONTEXT *aCtx) const
 

Private Attributes

std::unordered_map< TYPE_ID, PROPERTY_BASE * > m_matchingTypes
 
int m_itemIndex
 
LIBEVAL::VAR_TYPE_T m_type
 
bool m_isEnum
 

Detailed Description

Definition at line 148 of file pcb_expr_evaluator.h.

Constructor & Destructor Documentation

◆ PCB_EXPR_TYPE_REF()

PCB_EXPR_TYPE_REF::PCB_EXPR_TYPE_REF ( int  aItemIndex)
inline

Definition at line 151 of file pcb_expr_evaluator.h.

151 :
152 PCB_EXPR_VAR_REF( aItemIndex )
153 {
155 //printf("*** CreateVarRef %p %d\n", this, aItemIndex );
156 }
PCB_EXPR_VAR_REF(int aItemIndex)
void SetType(LIBEVAL::VAR_TYPE_T type)

References PCB_EXPR_VAR_REF::SetType(), and LIBEVAL::VT_STRING.

Member Function Documentation

◆ AddAllowedClass()

void PCB_EXPR_VAR_REF::AddAllowedClass ( TYPE_ID  type_hash,
PROPERTY_BASE prop 
)
inlineinherited

Definition at line 101 of file pcb_expr_evaluator.h.

102 {
103 m_matchingTypes[type_hash] = prop;
104 }
std::unordered_map< TYPE_ID, PROPERTY_BASE * > m_matchingTypes

References PCB_EXPR_VAR_REF::m_matchingTypes.

◆ GetObject()

BOARD_ITEM * PCB_EXPR_VAR_REF::GetObject ( const LIBEVAL::CONTEXT aCtx) const
inherited

Definition at line 36 of file pcb_expr_evaluator.cpp.

37{
38 wxASSERT( dynamic_cast<const PCB_EXPR_CONTEXT*>( aCtx ) );
39
40 const PCB_EXPR_CONTEXT* ctx = static_cast<const PCB_EXPR_CONTEXT*>( aCtx );
41 BOARD_ITEM* item = ctx->GetItem( m_itemIndex );
42 return item;
43}
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:70
BOARD_ITEM * GetItem(int index) const

References PCB_EXPR_CONTEXT::GetItem(), and PCB_EXPR_VAR_REF::m_itemIndex.

Referenced by enclosedByAreaFunc(), existsOnLayerFunc(), fromToFunc(), getFieldFunc(), PCB_EXPR_VAR_REF::GetValue(), PCB_EXPR_NETCLASS_REF::GetValue(), PCB_EXPR_NETNAME_REF::GetValue(), GetValue(), inDiffPairFunc(), intersectsAreaFunc(), intersectsBackCourtyardFunc(), intersectsCourtyardFunc(), intersectsFrontCourtyardFunc(), isBlindBuriedViaFunc(), isMicroVia(), isPlatedFunc(), and memberOfFunc().

◆ GetType()

LIBEVAL::VAR_TYPE_T PCB_EXPR_VAR_REF::GetType ( ) const
inlineoverridevirtualinherited

Implements LIBEVAL::VAR_REF.

Definition at line 99 of file pcb_expr_evaluator.h.

99{ return m_type; }
LIBEVAL::VAR_TYPE_T m_type

References PCB_EXPR_VAR_REF::m_type.

◆ GetValue()

LIBEVAL::VALUE * PCB_EXPR_TYPE_REF::GetValue ( LIBEVAL::CONTEXT aCtx)
overridevirtual

Reimplemented from PCB_EXPR_VAR_REF.

Definition at line 169 of file pcb_expr_evaluator.cpp.

170{
171 BOARD_ITEM* item = GetObject( aCtx );
172
173 if( !item )
174 return new LIBEVAL::VALUE();
175
176 return new LIBEVAL::VALUE( ENUM_MAP<KICAD_T>::Instance().ToString( item->Type() ) );
177}
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:97
BOARD_ITEM * GetObject(const LIBEVAL::CONTEXT *aCtx) const

References PCB_EXPR_VAR_REF::GetObject(), and EDA_ITEM::Type().

◆ IsEnum()

bool PCB_EXPR_VAR_REF::IsEnum ( ) const
inlineinherited

Definition at line 96 of file pcb_expr_evaluator.h.

96{ return m_isEnum; }

References PCB_EXPR_VAR_REF::m_isEnum.

◆ SetIsEnum()

void PCB_EXPR_VAR_REF::SetIsEnum ( bool  s)
inlineinherited

Definition at line 95 of file pcb_expr_evaluator.h.

95{ m_isEnum = s; }

References PCB_EXPR_VAR_REF::m_isEnum.

◆ SetType()

void PCB_EXPR_VAR_REF::SetType ( LIBEVAL::VAR_TYPE_T  type)
inlineinherited

Member Data Documentation

◆ m_isEnum

bool PCB_EXPR_VAR_REF::m_isEnum
privateinherited

◆ m_itemIndex

int PCB_EXPR_VAR_REF::m_itemIndex
privateinherited

◆ m_matchingTypes

std::unordered_map<TYPE_ID, PROPERTY_BASE*> PCB_EXPR_VAR_REF::m_matchingTypes
privateinherited

◆ m_type

LIBEVAL::VAR_TYPE_T PCB_EXPR_VAR_REF::m_type
privateinherited

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