25 #ifndef __PCB_EXPR_EVALUATOR_H 26 #define __PCB_EXPR_EVALUATOR_H 28 #include <unordered_map> 46 virtual std::unique_ptr<LIBEVAL::VAR_REF>
CreateVarRef(
const wxString& aVar,
const wxString& aField )
override;
172 wxString funcName = funcSignature.BeforeFirst(
'(' );
173 m_funcs[std::string( funcName.Lower() )] = std::move( funcPtr );
180 std::map<wxString, LIBEVAL::FUNC_CALL_REF>
m_funcs;
199 bool Evaluate(
const wxString& aExpr );
202 void SetErrorCallback( std::function<
void(
const wxString& aMessage,
int aOffset )> aCallback )
bool IsErrorPending() const
BOARD_ITEM * GetItem(int index) const
void SetItems(BOARD_ITEM *a, BOARD_ITEM *b=nullptr)
const wxArrayString GetSignatures() const
void SetErrorCallback(std::function< void(const wxString &aMessage, int aOffset)> aCallback)
const LIBEVAL::ERROR_STATUS & GetError() const
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
virtual LIBEVAL::FUNC_CALL_REF CreateFuncCall(const wxString &aName) override
size_t TYPE_ID
Unique type identifier.
void RegisterFunc(const wxString &funcSignature, LIBEVAL::FUNC_CALL_REF funcPtr)
LIBEVAL::FUNC_CALL_REF Get(const wxString &name)
std::map< wxString, LIBEVAL::FUNC_CALL_REF > m_funcs
void RegisterAllFunctions()
PCB_EXPR_NETNAME_REF(int aItemIndex)
PCB_LAYER_ID
A quick note on layer IDs:
PCB_EXPR_COMPILER m_compiler
std::function< void(CONTEXT *, void *)> FUNC_CALL_REF
LIBEVAL::VAR_TYPE_T m_type
virtual std::unique_ptr< LIBEVAL::VAR_REF > CreateVarRef(const wxString &aVar, const wxString &aField) override
void SetType(LIBEVAL::VAR_TYPE_T type)
PCB_EXPR_CONTEXT(PCB_LAYER_ID aLayer=UNDEFINED_LAYER)
PCB_EXPR_NETCLASS_REF(int aItemIndex)
PCB_EXPR_VAR_REF(int aItemIndex)
LIBEVAL::ERROR_STATUS m_errorStatus
LIBEVAL::VALUE GetValue(LIBEVAL::CONTEXT *aCtx) override
PCB_EXPR_BUILTIN_FUNCTIONS()
virtual LIBEVAL::VALUE GetValue(LIBEVAL::CONTEXT *aCtx) override
void AddAllowedClass(TYPE_ID type_hash, PROPERTY_BASE *prop)
bool Evaluate(const wxString &aExpr)
virtual ~PCB_EXPR_UCODE()
LIBEVAL::VALUE GetValue(LIBEVAL::CONTEXT *aCtx) override
void SetErrorCallback(std::function< void(const wxString &aMessage, int aOffset)> aCallback)
BOARD_ITEM * GetObject(const LIBEVAL::CONTEXT *aCtx) const
PCB_LAYER_ID GetLayer() const
std::unordered_map< TYPE_ID, PROPERTY_BASE * > m_matchingTypes
static PCB_EXPR_BUILTIN_FUNCTIONS & Instance()
LIBEVAL::VAR_TYPE_T GetType() const override