KiCad PCB EDA Suite
PCB_EXPR_BUILTIN_FUNCTIONS Class Reference

#include <pcb_expr_evaluator.h>

Public Member Functions

 PCB_EXPR_BUILTIN_FUNCTIONS ()
 
LIBEVAL::FUNC_CALL_REF Get (const wxString &name)
 
const wxArrayString GetSignatures () const
 
void RegisterFunc (const wxString &funcSignature, LIBEVAL::FUNC_CALL_REF funcPtr)
 
void RegisterAllFunctions ()
 

Static Public Member Functions

static PCB_EXPR_BUILTIN_FUNCTIONSInstance ()
 

Private Attributes

std::map< wxString, LIBEVAL::FUNC_CALL_REFm_funcs
 
wxArrayString m_funcSigs
 

Detailed Description

Definition at line 162 of file pcb_expr_evaluator.h.

Constructor & Destructor Documentation

◆ PCB_EXPR_BUILTIN_FUNCTIONS()

PCB_EXPR_BUILTIN_FUNCTIONS::PCB_EXPR_BUILTIN_FUNCTIONS ( )

Definition at line 959 of file pcb_expr_functions.cpp.

References RegisterAllFunctions().

Member Function Documentation

◆ Get()

LIBEVAL::FUNC_CALL_REF PCB_EXPR_BUILTIN_FUNCTIONS::Get ( const wxString &  name)
inline

Definition at line 173 of file pcb_expr_evaluator.h.

174 {
175 return m_funcs[ name ];
176 }
const char * name
Definition: DXF_plotter.cpp:56
std::map< wxString, LIBEVAL::FUNC_CALL_REF > m_funcs

References m_funcs, and name.

Referenced by PCB_EXPR_UCODE::CreateFuncCall().

◆ GetSignatures()

const wxArrayString PCB_EXPR_BUILTIN_FUNCTIONS::GetSignatures ( ) const
inline

Definition at line 178 of file pcb_expr_evaluator.h.

179 {
180 return m_funcSigs;
181 }

References m_funcSigs.

Referenced by PANEL_SETUP_RULES::onScintillaCharAdded().

◆ Instance()

static PCB_EXPR_BUILTIN_FUNCTIONS & PCB_EXPR_BUILTIN_FUNCTIONS::Instance ( )
inlinestatic

◆ RegisterAllFunctions()

void PCB_EXPR_BUILTIN_FUNCTIONS::RegisterAllFunctions ( )

Definition at line 965 of file pcb_expr_functions.cpp.

966{
967 m_funcs.clear();
968
969 RegisterFunc( wxT( "existsOnLayer('x')" ), existsOnLayerFunc );
970
971 RegisterFunc( wxT( "isPlated()" ), isPlatedFunc );
972
973 RegisterFunc( wxT( "insideCourtyard('x') DEPRECATED" ), intersectsCourtyardFunc );
974 RegisterFunc( wxT( "insideFrontCourtyard('x') DEPRECATED" ), intersectsFrontCourtyardFunc );
975 RegisterFunc( wxT( "insideBackCourtyard('x') DEPRECATED" ), intersectsBackCourtyardFunc );
976 RegisterFunc( wxT( "intersectsCourtyard('x')" ), intersectsCourtyardFunc );
977 RegisterFunc( wxT( "intersectsFrontCourtyard('x')" ), intersectsFrontCourtyardFunc );
978 RegisterFunc( wxT( "intersectsBackCourtyard('x')" ), intersectsBackCourtyardFunc );
979
980 RegisterFunc( wxT( "insideArea('x') DEPRECATED" ), intersectsAreaFunc );
981 RegisterFunc( wxT( "intersectsArea('x')" ), intersectsAreaFunc );
982 RegisterFunc( wxT( "enclosedByArea('x')" ), enclosedByAreaFunc );
983
984 RegisterFunc( wxT( "isMicroVia()" ), isMicroVia );
985 RegisterFunc( wxT( "isBlindBuriedVia()" ), isBlindBuriedViaFunc );
986
987 RegisterFunc( wxT( "memberOf('x')" ), memberOfFunc );
988
989 RegisterFunc( wxT( "fromTo('x','y')" ), fromToFunc );
990 RegisterFunc( wxT( "isCoupledDiffPair()" ), isCoupledDiffPairFunc );
991 RegisterFunc( wxT( "inDiffPair('x')" ), inDiffPairFunc );
992
993 RegisterFunc( wxT( "getField('x')" ), getFieldFunc );
994}
void RegisterFunc(const wxString &funcSignature, LIBEVAL::FUNC_CALL_REF funcPtr)
static void intersectsFrontCourtyardFunc(LIBEVAL::CONTEXT *aCtx, void *self)
static void intersectsBackCourtyardFunc(LIBEVAL::CONTEXT *aCtx, void *self)
static void isCoupledDiffPairFunc(LIBEVAL::CONTEXT *aCtx, void *self)
static void isPlatedFunc(LIBEVAL::CONTEXT *aCtx, void *self)
static void existsOnLayerFunc(LIBEVAL::CONTEXT *aCtx, void *self)
static void isBlindBuriedViaFunc(LIBEVAL::CONTEXT *aCtx, void *self)
static void enclosedByAreaFunc(LIBEVAL::CONTEXT *aCtx, void *self)
static void memberOfFunc(LIBEVAL::CONTEXT *aCtx, void *self)
static void isMicroVia(LIBEVAL::CONTEXT *aCtx, void *self)
static void getFieldFunc(LIBEVAL::CONTEXT *aCtx, void *self)
bool fromToFunc(LIBEVAL::CONTEXT *aCtx, void *self)
static void intersectsCourtyardFunc(LIBEVAL::CONTEXT *aCtx, void *self)
static void inDiffPairFunc(LIBEVAL::CONTEXT *aCtx, void *self)
static void intersectsAreaFunc(LIBEVAL::CONTEXT *aCtx, void *self)

References enclosedByAreaFunc(), existsOnLayerFunc(), fromToFunc(), getFieldFunc(), inDiffPairFunc(), intersectsAreaFunc(), intersectsBackCourtyardFunc(), intersectsCourtyardFunc(), intersectsFrontCourtyardFunc(), isBlindBuriedViaFunc(), isCoupledDiffPairFunc(), isMicroVia(), isPlatedFunc(), m_funcs, memberOfFunc(), and RegisterFunc().

Referenced by PCB_EXPR_BUILTIN_FUNCTIONS().

◆ RegisterFunc()

void PCB_EXPR_BUILTIN_FUNCTIONS::RegisterFunc ( const wxString &  funcSignature,
LIBEVAL::FUNC_CALL_REF  funcPtr 
)
inline

Definition at line 183 of file pcb_expr_evaluator.h.

184 {
185 wxString funcName = funcSignature.BeforeFirst( '(' );
186 m_funcs[std::string( funcName.Lower() )] = std::move( funcPtr );
187 m_funcSigs.Add( funcSignature );
188 }

References m_funcs, and m_funcSigs.

Referenced by RegisterAllFunctions().

Member Data Documentation

◆ m_funcs

std::map<wxString, LIBEVAL::FUNC_CALL_REF> PCB_EXPR_BUILTIN_FUNCTIONS::m_funcs
private

Definition at line 193 of file pcb_expr_evaluator.h.

Referenced by Get(), RegisterAllFunctions(), and RegisterFunc().

◆ m_funcSigs

wxArrayString PCB_EXPR_BUILTIN_FUNCTIONS::m_funcSigs
private

Definition at line 195 of file pcb_expr_evaluator.h.

Referenced by GetSignatures(), and RegisterFunc().


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