KiCad PCB EDA Suite
SCH_PLUGIN::SCH_PLUGIN_RELEASER Class Reference

Helper object to release a SCH_PLUGIN in the context of a potential thrown exception through its destructor. More...

#include <sch_io_mgr.h>

Public Member Functions

 SCH_PLUGIN_RELEASER (SCH_PLUGIN *aPlugin=NULL)
 
 ~SCH_PLUGIN_RELEASER ()
 
void release ()
 
void set (SCH_PLUGIN *aPlugin)
 
 operator SCH_PLUGIN * () const
 
SCH_PLUGINoperator -> () const
 

Private Member Functions

SCH_PLUGIN_RELEASERoperator= (SCH_PLUGIN_RELEASER &aOther)
 
 SCH_PLUGIN_RELEASER (const SCH_PLUGIN_RELEASER &aOther)
 

Private Attributes

SCH_PLUGINplugin
 

Detailed Description

Helper object to release a SCH_PLUGIN in the context of a potential thrown exception through its destructor.

Definition at line 516 of file sch_io_mgr.h.

Constructor & Destructor Documentation

◆ SCH_PLUGIN_RELEASER() [1/2]

SCH_PLUGIN::SCH_PLUGIN_RELEASER::SCH_PLUGIN_RELEASER ( const SCH_PLUGIN_RELEASER aOther)
inlineprivate

Definition at line 524 of file sch_io_mgr.h.

524 {}

◆ SCH_PLUGIN_RELEASER() [2/2]

SCH_PLUGIN::SCH_PLUGIN_RELEASER::SCH_PLUGIN_RELEASER ( SCH_PLUGIN aPlugin = NULL)
inline

Definition at line 527 of file sch_io_mgr.h.

527  :
528  plugin( aPlugin )
529  {
530  }

◆ ~SCH_PLUGIN_RELEASER()

SCH_PLUGIN::SCH_PLUGIN_RELEASER::~SCH_PLUGIN_RELEASER ( )
inline

Definition at line 532 of file sch_io_mgr.h.

533  {
534  if( plugin )
535  release();
536  }

References plugin, and release().

Member Function Documentation

◆ operator ->()

SCH_PLUGIN* SCH_PLUGIN::SCH_PLUGIN_RELEASER::operator -> ( ) const
inline

Definition at line 556 of file sch_io_mgr.h.

557  {
558  return plugin;
559  }

References plugin.

◆ operator SCH_PLUGIN *()

SCH_PLUGIN::SCH_PLUGIN_RELEASER::operator SCH_PLUGIN * ( ) const
inline

Definition at line 551 of file sch_io_mgr.h.

552  {
553  return plugin;
554  }

References plugin.

◆ operator=()

SCH_PLUGIN_RELEASER& SCH_PLUGIN::SCH_PLUGIN_RELEASER::operator= ( SCH_PLUGIN_RELEASER aOther)
inlineprivate

Definition at line 521 of file sch_io_mgr.h.

521 { return *this; }

◆ release()

void SCH_PLUGIN::SCH_PLUGIN_RELEASER::release ( )
inline

Definition at line 538 of file sch_io_mgr.h.

539  {
541  plugin = NULL;
542  }
#define NULL
static void ReleasePlugin(SCH_PLUGIN *aPlugin)
Release a SCH_PLUGIN back to the system, and may cause it to be unloaded from memory.
Definition: sch_io_mgr.cpp:69

References NULL, plugin, and SCH_IO_MGR::ReleasePlugin().

Referenced by set(), and ~SCH_PLUGIN_RELEASER().

◆ set()

void SCH_PLUGIN::SCH_PLUGIN_RELEASER::set ( SCH_PLUGIN aPlugin)
inline

Definition at line 544 of file sch_io_mgr.h.

545  {
546  if( plugin )
547  release();
548  plugin = aPlugin;
549  }

References plugin, and release().

Referenced by SYMBOL_LIB_TABLE_RESCUER::OpenRescueLibrary(), and SYMBOL_LIB_TABLE_ROW::setPlugin().

Member Data Documentation

◆ plugin

SCH_PLUGIN* SCH_PLUGIN::SCH_PLUGIN_RELEASER::plugin
private

Definition at line 518 of file sch_io_mgr.h.

Referenced by operator ->(), operator SCH_PLUGIN *(), release(), set(), and ~SCH_PLUGIN_RELEASER().


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