|
KiCad PCB EDA Suite
|
RAII guard that temporarily swaps SCHEMATIC::CurrentSheet to a given path for the duration of a scope, restoring it on exit. More...
#include <sch_diff_utils.h>
Public Member Functions | |
| SHEET_SCOPE (const SCHEMATIC *aSch, const SCH_SHEET_PATH *aPath) | |
| ~SHEET_SCOPE () | |
| SHEET_SCOPE (const SHEET_SCOPE &)=delete | |
| SHEET_SCOPE & | operator= (const SHEET_SCOPE &)=delete |
Private Attributes | |
| const SCHEMATIC * | m_sch |
| SCH_SHEET_PATH | m_saved |
RAII guard that temporarily swaps SCHEMATIC::CurrentSheet to a given path for the duration of a scope, restoring it on exit.
SCH_SYMBOL / SCH_FIELD property and bounding-box getters look up the active instance through SCHEMATIC::CurrentSheet(); the differ and the geometry extractor both need that to point at the item's own sheet path while they read it. SCHEMATIC::CurrentSheet() returns a non-const reference even off a const SCHEMATIC*, so no const_cast on the schematic itself is needed.
A null aPath leaves CurrentSheet untouched (only the original value is saved and restored), matching the differ's nullable-path call sites.
Definition at line 46 of file sch_diff_utils.h.
|
inline |
Definition at line 49 of file sch_diff_utils.h.
References m_saved, and m_sch.
Referenced by operator=(), and SHEET_SCOPE().
|
inline |
Definition at line 57 of file sch_diff_utils.h.
|
delete |
References SHEET_SCOPE().
|
delete |
References SHEET_SCOPE().
|
private |
Definition at line 68 of file sch_diff_utils.h.
Referenced by SHEET_SCOPE(), and ~SHEET_SCOPE().
|
private |
Definition at line 67 of file sch_diff_utils.h.
Referenced by SHEET_SCOPE(), and ~SHEET_SCOPE().