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 501 of file sch_io_mgr.h.

Constructor & Destructor Documentation

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

Definition at line 509 of file sch_io_mgr.h.

509 {}
SCH_PLUGIN::SCH_PLUGIN_RELEASER::SCH_PLUGIN_RELEASER ( SCH_PLUGIN aPlugin = NULL)
inline

Definition at line 512 of file sch_io_mgr.h.

512  :
513  plugin( aPlugin )
514  {
515  }
SCH_PLUGIN::SCH_PLUGIN_RELEASER::~SCH_PLUGIN_RELEASER ( )
inline

Definition at line 517 of file sch_io_mgr.h.

References release().

518  {
519  if( plugin )
520  release();
521  }

Member Function Documentation

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

Definition at line 536 of file sch_io_mgr.h.

References plugin.

537  {
538  return plugin;
539  }
SCH_PLUGIN* SCH_PLUGIN::SCH_PLUGIN_RELEASER::operator-> ( ) const
inline

Definition at line 541 of file sch_io_mgr.h.

References plugin.

542  {
543  return plugin;
544  }
SCH_PLUGIN_RELEASER& SCH_PLUGIN::SCH_PLUGIN_RELEASER::operator= ( SCH_PLUGIN_RELEASER aOther)
inlineprivate

Definition at line 506 of file sch_io_mgr.h.

506 { return *this; }
void SCH_PLUGIN::SCH_PLUGIN_RELEASER::release ( )
inline

Definition at line 523 of file sch_io_mgr.h.

References SCH_IO_MGR::ReleasePlugin().

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

524  {
526  plugin = NULL;
527  }
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:65
void SCH_PLUGIN::SCH_PLUGIN_RELEASER::set ( SCH_PLUGIN aPlugin)
inline

Definition at line 529 of file sch_io_mgr.h.

References release().

Referenced by SYMBOL_LIB_TABLE_ROW::setPlugin().

530  {
531  if( plugin )
532  release();
533  plugin = aPlugin;
534  }

Member Data Documentation

SCH_PLUGIN* SCH_PLUGIN::SCH_PLUGIN_RELEASER::plugin
private

Definition at line 503 of file sch_io_mgr.h.

Referenced by operator SCH_PLUGIN *(), and operator->().


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