KiCad PCB EDA Suite
Loading...
Searching...
No Matches
VIEW_OVERLAY_HOLDER Class Reference

RAII owner of a single VIEW_OVERLAY. More...

#include <view_overlay_holder.h>

Inheritance diagram for VIEW_OVERLAY_HOLDER:
CONSTRAINT_OVERLAY

Public Member Functions

 VIEW_OVERLAY_HOLDER (KIGFX::VIEW *aView)
 
virtual ~VIEW_OVERLAY_HOLDER ()
 
 VIEW_OVERLAY_HOLDER (const VIEW_OVERLAY_HOLDER &)=delete
 
VIEW_OVERLAY_HOLDERoperator= (const VIEW_OVERLAY_HOLDER &)=delete
 

Protected Attributes

KIGFX::VIEWm_view
 
std::shared_ptr< KIGFX::VIEW_OVERLAYm_overlay
 

Detailed Description

RAII owner of a single VIEW_OVERLAY.

VIEW::MakeOverlay() already registers the overlay with the view, so it must be removed exactly once and never Add()ed again. Getting that wrong leaves a dangling R-tree entry that the next repaint dereferences. Centralising the make/remove pair here keeps the invariant in one place. Derive from this to own a diagnostics or marker overlay.

Definition at line 39 of file view_overlay_holder.h.

Constructor & Destructor Documentation

◆ VIEW_OVERLAY_HOLDER() [1/2]

VIEW_OVERLAY_HOLDER::VIEW_OVERLAY_HOLDER ( KIGFX::VIEW * aView)

◆ ~VIEW_OVERLAY_HOLDER()

VIEW_OVERLAY_HOLDER::~VIEW_OVERLAY_HOLDER ( )
virtual

Definition at line 33 of file view_overlay_holder.cpp.

References m_overlay, and m_view.

◆ VIEW_OVERLAY_HOLDER() [2/2]

VIEW_OVERLAY_HOLDER::VIEW_OVERLAY_HOLDER ( const VIEW_OVERLAY_HOLDER & )
delete

References VIEW_OVERLAY_HOLDER().

Member Function Documentation

◆ operator=()

VIEW_OVERLAY_HOLDER & VIEW_OVERLAY_HOLDER::operator= ( const VIEW_OVERLAY_HOLDER & )
delete

References VIEW_OVERLAY_HOLDER().

Member Data Documentation

◆ m_overlay

std::shared_ptr<KIGFX::VIEW_OVERLAY> VIEW_OVERLAY_HOLDER::m_overlay
protected

◆ m_view


The documentation for this class was generated from the following files: