|
KiCad PCB EDA Suite
|
Identifies a single resolvable source that a text item's ${...} reference depends on.
More...
#include <text_var_dependency.h>
Public Types | |
| enum class | KIND : std::uint8_t { LOCAL , CROSS_REF , PROJECT_VAR , ENV_VAR , TITLE_BLOCK , SPECIAL , OP } |
| Categorizes a reference by the source that will produce its value. More... | |
Public Member Functions | |
| bool | operator== (const TEXT_VAR_REF_KEY &) const =default |
| bool | IsTrackable () const |
Static Public Member Functions | |
| static TEXT_VAR_REF_KEY | FromToken (const wxString &aToken) |
Parse a raw token (the text between ${ and }) into a key using lexical classification only — no lookup against project state or item context. | |
Public Attributes | |
| KIND | kind = KIND::LOCAL |
| wxString | primary |
| wxString | secondary |
Identifies a single resolvable source that a text item's ${...} reference depends on.
Keys are the currency of the dependency index. An edit that invalidates a key fans out to every EDA_ITEM registered under that key. The encoding mirrors the shape of the source token so that lexical extraction maps 1:1 to key creation with no resolver context needed.
Definition at line 47 of file text_var_dependency.h.
|
strong |
Categorizes a reference by the source that will produce its value.
The listener adapter for each module routes invalidation based on KIND, so expanding this taxonomy was a prerequisite for accurate fan-out (see Phase 3b plan).
${VALUE}, ${REFERENCE} etc. — resolved against the item's own context (a footprint's fields, a symbol's fields). Changes fan out only to self.${REFDES:FIELD} — primary=refdes, secondary=field. Keyed by refdes string so renames fire on both old/new.${KICAD_FOOTPRINT_DIR} etc. — OS/KiCad env vars.${PROJECTNAME}, ${REVISION}, ${ISSUE_DATE}, etc. Owned by PROJECT/title block, not any item.${SHEETNAME}, ${SHEETPATH}, ${FILENAME}, ${CURRENT_DATE}, ${VCSHASH}. Context-dependent resolution; mostly non-user-editable.${OP}, ${OP:port} — SPICE operating points. Recomputed from simulation state, not edits; tracker deliberately does not register OP-kind keys as dependencies (no listener drives them). | Enumerator | |
|---|---|
| LOCAL | |
| CROSS_REF | |
| PROJECT_VAR | |
| ENV_VAR | |
| TITLE_BLOCK | |
| SPECIAL | |
| OP | |
Definition at line 73 of file text_var_dependency.h.
|
static |
Parse a raw token (the text between ${ and }) into a key using lexical classification only — no lookup against project state or item context.
Tokens with an embedded : become CROSS_REF or OP; tokens whose name matches a known built-in (PROJECTNAME, SHEETNAME, etc.) are categorized into TITLE_BLOCK / SPECIAL; everything else defaults to LOCAL and the adapter promotes to PROJECT_VAR or ENV_VAR based on the project state at registration time.
Definition at line 60 of file text_var_dependency.cpp.
References CROSS_REF, kind, left, LOCAL, OP, primary, right, secondary, SPECIAL, and TITLE_BLOCK.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and operator==().
|
inline |
Definition at line 101 of file text_var_dependency.h.
Referenced by BOOST_AUTO_TEST_CASE().
|
default |
References FromToken().
| KIND TEXT_VAR_REF_KEY::kind = KIND::LOCAL |
Definition at line 84 of file text_var_dependency.h.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOARD_TEXT_VAR_ADAPTER::ExtractSourceKeys(), SCHEMATIC_TEXT_VAR_ADAPTER::ExtractSourceKeys(), FromToken(), IsTrackable(), and TEXT_VAR_REF_KEY_HASH::operator()().
| wxString TEXT_VAR_REF_KEY::primary |
Definition at line 85 of file text_var_dependency.h.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOARD_TEXT_VAR_ADAPTER::ExtractSourceKeys(), SCHEMATIC_TEXT_VAR_ADAPTER::ExtractSourceKeys(), FromToken(), and TEXT_VAR_REF_KEY_HASH::operator()().
| wxString TEXT_VAR_REF_KEY::secondary |
Definition at line 86 of file text_var_dependency.h.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOARD_TEXT_VAR_ADAPTER::ExtractSourceKeys(), SCHEMATIC_TEXT_VAR_ADAPTER::ExtractSourceKeys(), FromToken(), and TEXT_VAR_REF_KEY_HASH::operator()().