kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #25238
Re: [PATCH 11/16] Clarify ownership semantics
Simon,
I'm going to hold off on this patch until after we meet at CERN. It
will be much easier for me to explain to you in person rather than
writing a thesis how SCH_SCREEN does and should behave. Once you have
all of the pertinent information, you might be able to come up with and
improved solution.
Cheers,
Wayne
On 6/7/2016 3:54 PM, Simon Richter wrote:
>
> SCREEN objects are typically owned by the DRAW_FRAME they are attached to.
>
> SCH_SCREEN objects may additionally be shared between one DRAW_FRAME, and
> multiple SCH_SHEET objects, so they are reference counted.
>
> To make this distinction more obvious, and avoid potential errors, move the
> pointer into the derived DRAW_FRAME, with an appropriate smart pointer
> type. This also avoids a few C-style casts and replaces them by compile
> time checks.
> ---
> common/draw_frame.cpp | 6 +----
> eeschema/class_sch_screen.h | 32 ++++++++++++++++++++------
> eeschema/sch_base_frame.cpp | 5 ----
> eeschema/sch_base_frame.h | 6 ++++-
> eeschema/sch_screen.cpp | 2 ++
> eeschema/sch_sheet.cpp | 46 ++++++++-----------------------------
> eeschema/sch_sheet.h | 11 ++++-----
> eeschema/sheet.cpp | 4 ++--
> gerbview/gerbview_frame.h | 5 ++++
> include/draw_frame.h | 6 +----
> include/wxBasePcbFrame.h | 6 ++++-
> pagelayout_editor/pl_editor_frame.h | 8 +++----
> 12 files changed, 64 insertions(+), 73 deletions(-)
>
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers
> Post to : kicad-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help : https://help.launchpad.net/ListHelp
>
References
-
[PATCH 00/16] Simple patches
From: Simon Richter, 2016-06-07
-
[PATCH 01/16] Fix spelling "propage" -> "propagate"
From: Simon Richter, 2016-06-07
-
[PATCH 02/16] Add missing dependency github_plugin -> pcbcommon
From: Simon Richter, 2016-06-07
-
[PATCH 03/16] Clarify ERC: we're iterating netlist items, not nets
From: Simon Richter, 2016-06-07
-
[PATCH 04/16] Explain how ERC works.
From: Simon Richter, 2016-06-07
-
[PATCH 05/16] Cache netlist item during ERC
From: Simon Richter, 2016-06-07
-
[PATCH 06/16] Check sorting of netlist during ERC
From: Simon Richter, 2016-06-07
-
[PATCH 07/16] Kill unused NETLIST_EXPORTER_GENERIC::writeListOfNets
From: Simon Richter, 2016-06-07
-
[PATCH 08/16] Drop extra copy ctors from IFSG_NODE
From: Simon Richter, 2016-06-07
-
[PATCH 09/16] Replace boost::shared_ptr with std::shared_ptr
From: Simon Richter, 2016-06-07
-
[PATCH 10/16] Replace unshared boost::shared_array with std::unique_ptr
From: Simon Richter, 2016-06-07
-
[PATCH 11/16] Clarify ownership semantics
From: Simon Richter, 2016-06-07