wiRedPanda
Logic Circuit Simulator
Loading...
Searching...
No Matches
ItemWithId.cpp
Go to the documentation of this file.
1// Copyright 2015 - 2026, GIBIS-UNIFESP and the wiRedPanda contributors
2// SPDX-License-Identifier: GPL-3.0-or-later
3
5
7
8// Virtual destructor entry/exit is exercised constantly (every GraphicElement/
9// Connection destruction across the suite) but never separately attributed by
10// gcov — same ABI-variant gap as App/Wiring/Port.h's destructor: no code in
11// the repo ever `delete`s through a bare ItemWithId*, so this class's own D0
12// (deleting destructor) never runs — every real deletion goes through the
13// concrete GraphicElement/Connection type's own D0, which invokes this D2
14// (base-object destructor) as part of that unwind instead.
15ItemWithId::~ItemWithId() // LCOV_EXCL_LINE
16{
17 if (m_registry) {
18 m_registry->forget(this);
19 }
20} // LCOV_EXCL_LINE
Defines ItemWithId, the base class for all uniquely identified circuit items.
SceneItemRegistry: maps stable integer IDs to the scene's identifiable items.
virtual ~ItemWithId()
Self-unregisters from the current SceneItemRegistry, if any.