← Back to team overview

kicad-developers team mailing list archive

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