KiCad PCB EDA Suite
KICAD_PLUGIN_LDR Class Referenceabstract

#include <pluginldr.h>

Inheritance diagram for KICAD_PLUGIN_LDR:
KICAD_PLUGIN_LDR_3D

Public Member Functions

 KICAD_PLUGIN_LDR ()
 
virtual ~KICAD_PLUGIN_LDR ()
 
virtual void GetLoaderVersion (unsigned char *Major, unsigned char *Minor, unsigned char *Patch, unsigned char *Revision) const =0
 Function GetLoaderVersion returns the version information of the Plugin Loader for plugin compatibility checking. More...
 
virtual bool Open (const wxString &aFullFileName)=0
 Function Open opens a plugin of the given class, performs version compatibility checks, and links all required functions. More...
 
virtual void Close (void)=0
 Function Close cleans up and closes/unloads the plugin. More...
 
std::string GetLastError (void) const
 Function GetLastError returns the value of the internal error string. More...
 
char const * GetKicadPluginClass (void)
 
bool GetClassVersion (unsigned char *Major, unsigned char *Minor, unsigned char *Patch, unsigned char *Revision)
 
bool CheckClassVersion (unsigned char Major, unsigned char Minor, unsigned char Patch, unsigned char Revision)
 
const char * GetKicadPluginName (void)
 
bool GetVersion (unsigned char *Major, unsigned char *Minor, unsigned char *Patch, unsigned char *Revision)
 
void GetPluginInfo (std::string &aPluginInfo)
 

Protected Member Functions

bool open (const wxString &aFullFileName, const char *aPluginClass)
 Function open opens a plugin of the specified class and links the extensions required by kicad_plugin. More...
 
void close (void)
 Function close nullifies internal pointers in preparation for closing the plugin. More...
 
bool reopen (void)
 Function reopen reopens a plugin and returns true on success. More...
 

Protected Attributes

std::string m_error
 
wxDynamicLibrary m_PluginLoader
 

Private Attributes

bool ok
 
GET_PLUGIN_CLASS m_getPluginClass
 
GET_CLASS_VERSION m_getClassVersion
 
CHECK_CLASS_VERSION m_checkClassVersion
 
GET_PLUGIN_NAME m_getPluginName
 
GET_VERSION m_getVersion
 
wxString m_fileName
 
std::string m_pluginInfo
 

Detailed Description

Definition at line 59 of file pluginldr.h.

Constructor & Destructor Documentation

◆ KICAD_PLUGIN_LDR()

KICAD_PLUGIN_LDR::KICAD_PLUGIN_LDR ( )

Definition at line 34 of file pluginldr.cpp.

35 {
36  ok = false;
42 
43  return;
44 }
GET_CLASS_VERSION m_getClassVersion
Definition: pluginldr.h:64
GET_PLUGIN_CLASS m_getPluginClass
Definition: pluginldr.h:63
#define NULL
GET_VERSION m_getVersion
Definition: pluginldr.h:67
CHECK_CLASS_VERSION m_checkClassVersion
Definition: pluginldr.h:65
GET_PLUGIN_NAME m_getPluginName
Definition: pluginldr.h:66

References m_checkClassVersion, m_getClassVersion, m_getPluginClass, m_getPluginName, m_getVersion, NULL, and ok.

◆ ~KICAD_PLUGIN_LDR()

KICAD_PLUGIN_LDR::~KICAD_PLUGIN_LDR ( )
virtual

Definition at line 47 of file pluginldr.cpp.

48 {
49  close();
50  return;
51 }
void close(void)
Function close nullifies internal pointers in preparation for closing the plugin.
Definition: pluginldr.cpp:284

References close().

Member Function Documentation

◆ CheckClassVersion()

bool KICAD_PLUGIN_LDR::CheckClassVersion ( unsigned char  Major,
unsigned char  Minor,
unsigned char  Patch,
unsigned char  Revision 
)

Definition at line 409 of file pluginldr.cpp.

411 {
412  m_error.clear();
413 
414  if( !ok && !reopen() )
415  {
416  if( m_error.empty() )
417  m_error = "[INFO] no open plugin / plugin could not be opened";
418 
419  return false;
420  }
421 
422  if( NULL == m_checkClassVersion )
423  {
424  m_error = "[BUG] CheckClassVersion is not linked";
425 
426  #ifdef DEBUG
427  std::ostringstream ostr;
428  ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
429  ostr << " * " << m_error;
430  wxLogTrace( MASK_PLUGINLDR, "%s\n", ostr.str().c_str() );
431  #endif
432 
433  return false;
434  }
435 
436  return m_checkClassVersion( Major, Minor, Patch, Revision );
437 }
#define MASK_PLUGINLDR
Definition: pluginldr.h:37
std::string m_error
Definition: pluginldr.h:73
#define NULL
bool reopen(void)
Function reopen reopens a plugin and returns true on success.
Definition: pluginldr.cpp:298
CHECK_CLASS_VERSION m_checkClassVersion
Definition: pluginldr.h:65

References m_checkClassVersion, m_error, MASK_PLUGINLDR, NULL, ok, and reopen().

◆ close()

void KICAD_PLUGIN_LDR::close ( void  )
protected

Function close nullifies internal pointers in preparation for closing the plugin.

Definition at line 284 of file pluginldr.cpp.

285 {
286  ok = false;
291  m_getVersion = NULL;
292  m_PluginLoader.Unload();
293 
294  return;
295 }
wxDynamicLibrary m_PluginLoader
Definition: pluginldr.h:96
GET_CLASS_VERSION m_getClassVersion
Definition: pluginldr.h:64
GET_PLUGIN_CLASS m_getPluginClass
Definition: pluginldr.h:63
#define NULL
GET_VERSION m_getVersion
Definition: pluginldr.h:67
CHECK_CLASS_VERSION m_checkClassVersion
Definition: pluginldr.h:65
GET_PLUGIN_NAME m_getPluginName
Definition: pluginldr.h:66

References m_checkClassVersion, m_getClassVersion, m_getPluginClass, m_getPluginName, m_getVersion, m_PluginLoader, NULL, and ok.

Referenced by KICAD_PLUGIN_LDR_3D::Close(), open(), and ~KICAD_PLUGIN_LDR().

◆ Close()

virtual void KICAD_PLUGIN_LDR::Close ( void  )
pure virtual

Function Close cleans up and closes/unloads the plugin.

Implemented in KICAD_PLUGIN_LDR_3D.

Referenced by open().

◆ GetClassVersion()

bool KICAD_PLUGIN_LDR::GetClassVersion ( unsigned char *  Major,
unsigned char *  Minor,
unsigned char *  Patch,
unsigned char *  Revision 
)

Definition at line 347 of file pluginldr.cpp.

349 {
350  m_error.clear();
351 
352  if( Major )
353  *Major = 0;
354 
355  if( Minor )
356  *Minor = 0;
357 
358  if( Patch )
359  *Patch = 0;
360 
361  if( Revision )
362  *Revision = 0;
363 
364  unsigned char major;
365  unsigned char minor;
366  unsigned char patch;
367  unsigned char revno;
368 
369  if( !ok && !reopen() )
370  {
371  if( m_error.empty() )
372  m_error = "[INFO] no open plugin / plugin could not be opened";
373 
374  return false;
375  }
376 
377  if( NULL == m_checkClassVersion )
378  {
379  m_error = "[BUG] CheckClassVersion is not linked";
380 
381  #ifdef DEBUG
382  std::ostringstream ostr;
383  ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
384  ostr << " * " << m_error;
385  wxLogTrace( MASK_PLUGINLDR, "%s\n", ostr.str().c_str() );
386  #endif
387 
388  return false;
389  }
390 
391  m_getClassVersion( &major, &minor, &patch, &revno );
392 
393  if( Major )
394  *Major = major;
395 
396  if( Minor )
397  *Minor = minor;
398 
399  if( Patch )
400  *Patch = patch;
401 
402  if( Revision )
403  *Revision = revno;
404 
405  return true;
406 }
GET_CLASS_VERSION m_getClassVersion
Definition: pluginldr.h:64
#define MASK_PLUGINLDR
Definition: pluginldr.h:37
std::string m_error
Definition: pluginldr.h:73
#define NULL
bool reopen(void)
Function reopen reopens a plugin and returns true on success.
Definition: pluginldr.cpp:298
CHECK_CLASS_VERSION m_checkClassVersion
Definition: pluginldr.h:65

References m_checkClassVersion, m_error, m_getClassVersion, MASK_PLUGINLDR, NULL, ok, and reopen().

◆ GetKicadPluginClass()

char const * KICAD_PLUGIN_LDR::GetKicadPluginClass ( void  )

Definition at line 317 of file pluginldr.cpp.

318 {
319  m_error.clear();
320 
321  if( !ok && !reopen() )
322  {
323  if( m_error.empty() )
324  m_error = "[INFO] no open plugin / plugin could not be opened";
325 
326  return NULL;
327  }
328 
329  if( NULL == m_getPluginClass )
330  {
331  m_error = "[BUG] GetPluginClass is not linked";
332 
333  #ifdef DEBUG
334  std::ostringstream ostr;
335  ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
336  ostr << " * " << m_error;
337  wxLogTrace( MASK_PLUGINLDR, "%s\n", ostr.str().c_str() );
338  #endif
339 
340  return NULL;
341  }
342 
343  return m_getPluginClass();
344 }
#define MASK_PLUGINLDR
Definition: pluginldr.h:37
std::string m_error
Definition: pluginldr.h:73
GET_PLUGIN_CLASS m_getPluginClass
Definition: pluginldr.h:63
#define NULL
bool reopen(void)
Function reopen reopens a plugin and returns true on success.
Definition: pluginldr.cpp:298

References m_error, m_getPluginClass, MASK_PLUGINLDR, NULL, ok, and reopen().

◆ GetKicadPluginName()

const char * KICAD_PLUGIN_LDR::GetKicadPluginName ( void  )

Definition at line 440 of file pluginldr.cpp.

441 {
442  m_error.clear();
443 
444  if( !ok && !reopen() )
445  {
446  if( m_error.empty() )
447  m_error = "[INFO] no open plugin / plugin could not be opened";
448 
449  return NULL;
450  }
451 
452  if( NULL == m_getPluginName )
453  {
454  m_error = "[BUG] GetKicadPluginName is not linked";
455 
456  #ifdef DEBUG
457  std::ostringstream ostr;
458  ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
459  ostr << " * " << m_error;
460  wxLogTrace( MASK_PLUGINLDR, "%s\n", ostr.str().c_str() );
461  #endif
462 
463  return NULL;
464  }
465 
466  return m_getPluginName();
467 }
#define MASK_PLUGINLDR
Definition: pluginldr.h:37
std::string m_error
Definition: pluginldr.h:73
#define NULL
bool reopen(void)
Function reopen reopens a plugin and returns true on success.
Definition: pluginldr.cpp:298
GET_PLUGIN_NAME m_getPluginName
Definition: pluginldr.h:66

References m_error, m_getPluginName, MASK_PLUGINLDR, NULL, ok, and reopen().

Referenced by open().

◆ GetLastError()

std::string KICAD_PLUGIN_LDR::GetLastError ( void  ) const

Function GetLastError returns the value of the internal error string.

Definition at line 311 of file pluginldr.cpp.

312 {
313  return m_error;
314 }
std::string m_error
Definition: pluginldr.h:73

References m_error.

◆ GetLoaderVersion()

virtual void KICAD_PLUGIN_LDR::GetLoaderVersion ( unsigned char *  Major,
unsigned char *  Minor,
unsigned char *  Patch,
unsigned char *  Revision 
) const
pure virtual

Function GetLoaderVersion returns the version information of the Plugin Loader for plugin compatibility checking.

Implemented in KICAD_PLUGIN_LDR_3D.

Referenced by open().

◆ GetPluginInfo()

void KICAD_PLUGIN_LDR::GetPluginInfo ( std::string &  aPluginInfo)

Definition at line 503 of file pluginldr.cpp.

504 {
505  aPluginInfo = m_pluginInfo;
506 }
std::string m_pluginInfo
Definition: pluginldr.h:70

References m_pluginInfo.

◆ GetVersion()

bool KICAD_PLUGIN_LDR::GetVersion ( unsigned char *  Major,
unsigned char *  Minor,
unsigned char *  Patch,
unsigned char *  Revision 
)

Definition at line 470 of file pluginldr.cpp.

472 {
473  m_error.clear();
474 
475  if( !ok && !reopen() )
476  {
477  if( m_error.empty() )
478  m_error = "[INFO] no open plugin / plugin could not be opened";
479 
480  return false;
481  }
482 
483  if( NULL == m_getVersion )
484  {
485  m_error = "[BUG] GetKicadPluginName is not linked";
486 
487  #ifdef DEBUG
488  std::ostringstream ostr;
489  ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
490  ostr << " * " << m_error;
491  wxLogTrace( MASK_PLUGINLDR, "%s\n", ostr.str().c_str() );
492  #endif
493 
494  return false;
495  }
496 
497  m_getVersion( Major, Minor, Patch, Revision );
498 
499  return true;
500 }
#define MASK_PLUGINLDR
Definition: pluginldr.h:37
std::string m_error
Definition: pluginldr.h:73
#define NULL
bool reopen(void)
Function reopen reopens a plugin and returns true on success.
Definition: pluginldr.cpp:298
GET_VERSION m_getVersion
Definition: pluginldr.h:67

References m_error, m_getVersion, MASK_PLUGINLDR, NULL, ok, and reopen().

Referenced by open().

◆ open()

bool KICAD_PLUGIN_LDR::open ( const wxString &  aFullFileName,
const char *  aPluginClass 
)
protected

Function open opens a plugin of the specified class and links the extensions required by kicad_plugin.

Returns true on success otherwise false.

Definition at line 54 of file pluginldr.cpp.

55 {
56  m_error.clear();
57 
58  if( ok )
59  Close();
60 
61  if( aFullFileName.empty() )
62  return false;
63 
64  m_fileName.clear();
65 
66  m_PluginLoader.Load( aFullFileName, wxDL_LAZY );
67 
68  if( !m_PluginLoader.IsLoaded() )
69  {
70  #ifdef DEBUG
71  std::ostringstream ostr;
72  ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
73  ostr << " * could not open file: '" << aFullFileName.ToUTF8() << "'";
74  wxLogTrace( MASK_PLUGINLDR, "%s\n", ostr.str().c_str() );
75  #endif
76  return false;
77  }
78 
79  LINK_ITEM( m_getPluginClass, GET_PLUGIN_CLASS, "GetKicadPluginClass" );
80  LINK_ITEM( m_getClassVersion, GET_CLASS_VERSION, "GetClassVersion" );
81  LINK_ITEM( m_checkClassVersion, CHECK_CLASS_VERSION , "CheckClassVersion" );
82  LINK_ITEM( m_getPluginName, GET_PLUGIN_NAME, "GetKicadPluginName" );
83  LINK_ITEM( m_getVersion, GET_VERSION, "GetPluginVersion" );
84 
85  #ifdef DEBUG
86  bool fail = false;
87 
88  if( !m_getPluginClass )
89  {
90  std::ostringstream ostr;
91  ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
92  wxString errmsg = "incompatible plugin (missing function 'GetKicadPluginClass')";
93  ostr << errmsg.ToUTF8() << "\n";
94  ostr << "'" << aFullFileName.ToUTF8() << "'";
95  wxLogTrace( MASK_PLUGINLDR, "%s\n", ostr.str().c_str() );
96  fail = true;
97  }
98 
99  if( !m_getClassVersion )
100  {
101  if( !fail )
102  {
103  std::ostringstream ostr;
104  ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
105  wxString errmsg = "incompatible plugin (missing function 'GetClassVersion')";
106  ostr << errmsg.ToUTF8() << "\n";
107  ostr << "'" << aFullFileName.ToUTF8() << "'";
108  wxLogTrace( MASK_PLUGINLDR, "%s\n", ostr.str().c_str() );
109  fail = true;
110  }
111  else
112  {
113  std::ostringstream ostr;
114  wxString errmsg = "missing function 'GetClassVersion'";
115  ostr << errmsg.ToUTF8();
116  wxLogTrace( MASK_PLUGINLDR, "%s\n", ostr.str().c_str() );
117  }
118  }
119 
120  if( !m_checkClassVersion )
121  {
122  if( !fail )
123  {
124  std::ostringstream ostr;
125  ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
126  wxString errmsg = "incompatible plugin (missing function 'CheckClassVersion')";
127  ostr << errmsg.ToUTF8() << "\n";
128  ostr << "'" << aFullFileName.ToUTF8() << "'";
129  wxLogTrace( MASK_PLUGINLDR, "%s\n", ostr.str().c_str() );
130  fail = true;
131  }
132  else
133  {
134  std::ostringstream ostr;
135  wxString errmsg = "missing function 'CheckClassVersion'";
136  ostr << errmsg.ToUTF8();
137  wxLogTrace( MASK_PLUGINLDR, "%s\n", ostr.str().c_str() );
138  }
139  }
140 
141  if( !m_getPluginName )
142  {
143  if( !fail )
144  {
145  std::ostringstream ostr;
146  ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
147  wxString errmsg = "incompatible plugin (missing function 'GetKicadPluginName')";
148  ostr << errmsg.ToUTF8() << "\n";
149  ostr << "'" << aFullFileName.ToUTF8() << "'";
150  wxLogTrace( MASK_PLUGINLDR, "%s\n", ostr.str().c_str() );
151  fail = true;
152  }
153  else
154  {
155  std::ostringstream ostr;
156  wxString errmsg = "missing function 'GetKicadPluginName'";
157  ostr << errmsg.ToUTF8();
158  wxLogTrace( MASK_PLUGINLDR, "%s\n", ostr.str().c_str() );
159  }
160  }
161 
162  if( !m_getVersion )
163  {
164  if( !fail )
165  {
166  std::ostringstream ostr;
167  ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
168  wxString errmsg = "incompatible plugin (missing function 'GetVersion')";
169  ostr << errmsg.ToUTF8() << "\n";
170  ostr << "'" << aFullFileName.ToUTF8() << "'";
171  wxLogTrace( MASK_PLUGINLDR, "%s\n", ostr.str().c_str() );
172  }
173  else
174  {
175  std::ostringstream ostr;
176  wxString errmsg = "missing function 'GetVersion'";
177  ostr << errmsg.ToUTF8() << "\n";
178  wxLogTrace( MASK_PLUGINLDR, "%s\n", ostr.str().c_str() );
179  }
180  }
181 
182  #endif
183 
185  || !m_getPluginName || !m_getVersion )
186  {
187  m_error = "incompatible plugin interface (missing functions)";
188  close();
189  return false;
190  }
191 
192  // note: since 'ok' is not yet set at this point we must use the function
193  // pointers directly rather than invoking the functions exposed by this class
194 
195  // check that the Plugin Class matches
196  char const* pclassName = m_getPluginClass();
197 
198  if( !pclassName || strcmp( aPluginClass, pclassName ) )
199  {
200  m_error = "Loader type (";
201  m_error.append( aPluginClass );
202  m_error.append( ") does not match Plugin type (" );
203 
204  if( pclassName )
205  m_error.append( pclassName );
206  else
207  m_error.append( "NULL" );
208 
209  m_error.append( ")" );
210 
211  close();
212  return false;
213  }
214 
215  // perform a universally enforced version check (major number must match)
216  unsigned char lMajor;
217  unsigned char lMinor;
218  unsigned char lPatch;
219  unsigned char lRevno;
220  unsigned char pMajor;
221  unsigned char pMinor;
222  unsigned char pPatch;
223  unsigned char pRevno;
224 
225  m_getClassVersion( &pMajor, &pMinor, &pPatch, &pRevno );
226  GetLoaderVersion( &lMajor, &lMinor, &lPatch, &lRevno );
227 
228  // major version changes by definition are incompatible and
229  // that is enforced here.
230  if( pMajor != lMajor )
231  {
232  std::ostringstream ostr;
233  ostr << "Loader Major version (" << lMajor;
234  ostr << ") does not match Plugin Major version (" << pMajor << ")";
235 
236  m_error = ostr.str();
237  close();
238  return false;
239  }
240 
241  if( !m_checkClassVersion( lMajor, lMinor, lPatch, lRevno ) )
242  {
243  std::ostringstream ostr;
244  ostr << "Plugin Version (" << pMajor << "." << pMinor << "." << pPatch << "." << pRevno;
245  ostr << ") does not support Loader Version (" << pMajor << "." << pMinor;
246  ostr << "." << pPatch << "." << pRevno << ")";
247 
248  m_error = ostr.str();
249  close();
250  return false;
251  }
252 
253  m_fileName = aFullFileName;
254 
255  #ifdef DEBUG
256  do {
257  std::ostringstream ostr;
258  ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
259  ostr << " * [INFO] opened plugin " << m_fileName.ToUTF8();
260  char const* cp = m_getPluginName();
261 
262  if( NULL != cp )
263  ostr << " * [INFO] plugin name: '" << cp << "'\n";
264 
265  wxLogTrace( MASK_PLUGINLDR, "%s\n", ostr.str().c_str() );
266  } while( 0 );
267  #endif
268 
269  ok = true;
270 
271  // set the plugin info string
273  std::ostringstream ostr;
274  unsigned char r0, r1, r2, r3;
275  GetVersion( &r0, &r1, &r2, &r3 );
276  ostr << ":" << (unsigned int)r0 << "." << (unsigned int)r1;
277  ostr << "." << (unsigned int)r2 << "." << (unsigned int)r3;
278  m_pluginInfo.append( ostr.str() );
279 
280  return true;
281 }
virtual void GetLoaderVersion(unsigned char *Major, unsigned char *Minor, unsigned char *Patch, unsigned char *Revision) const =0
Function GetLoaderVersion returns the version information of the Plugin Loader for plugin compatibili...
const char * GetKicadPluginName(void)
Definition: pluginldr.cpp:440
wxDynamicLibrary m_PluginLoader
Definition: pluginldr.h:96
GET_CLASS_VERSION m_getClassVersion
Definition: pluginldr.h:64
char const *(* GET_PLUGIN_CLASS)(void)
Definition: pluginldr.h:45
#define MASK_PLUGINLDR
Definition: pluginldr.h:37
void(* GET_CLASS_VERSION)(unsigned char *, unsigned char *, unsigned char *, unsigned char *)
Definition: pluginldr.h:47
std::string m_error
Definition: pluginldr.h:73
bool GetVersion(unsigned char *Major, unsigned char *Minor, unsigned char *Patch, unsigned char *Revision)
Definition: pluginldr.cpp:470
wxString m_fileName
Definition: pluginldr.h:69
const char *(* GET_PLUGIN_NAME)(void)
Definition: pluginldr.h:53
GET_PLUGIN_CLASS m_getPluginClass
Definition: pluginldr.h:63
#define NULL
std::string m_pluginInfo
Definition: pluginldr.h:70
bool(* CHECK_CLASS_VERSION)(unsigned char, unsigned char, unsigned char, unsigned char)
Definition: pluginldr.h:50
GET_VERSION m_getVersion
Definition: pluginldr.h:67
void(* GET_VERSION)(unsigned char *, unsigned char *, unsigned char *, unsigned char *)
Definition: pluginldr.h:55
CHECK_CLASS_VERSION m_checkClassVersion
Definition: pluginldr.h:65
virtual void Close(void)=0
Function Close cleans up and closes/unloads the plugin.
void close(void)
Function close nullifies internal pointers in preparation for closing the plugin.
Definition: pluginldr.cpp:284
#define LINK_ITEM(funcPtr, funcType, funcName)
Definition: pluginldr.h:41
GET_PLUGIN_NAME m_getPluginName
Definition: pluginldr.h:66

References close(), Close(), GetKicadPluginName(), GetLoaderVersion(), GetVersion(), LINK_ITEM, m_checkClassVersion, m_error, m_fileName, m_getClassVersion, m_getPluginClass, m_getPluginName, m_getVersion, m_pluginInfo, m_PluginLoader, MASK_PLUGINLDR, NULL, and ok.

Referenced by KICAD_PLUGIN_LDR_3D::Open().

◆ Open()

virtual bool KICAD_PLUGIN_LDR::Open ( const wxString &  aFullFileName)
pure virtual

Function Open opens a plugin of the given class, performs version compatibility checks, and links all required functions.

Returns
true on success, otherwise false and a message may be accessible via GetLastError()

Implemented in KICAD_PLUGIN_LDR_3D.

Referenced by reopen().

◆ reopen()

bool KICAD_PLUGIN_LDR::reopen ( void  )
protected

Function reopen reopens a plugin and returns true on success.

Definition at line 298 of file pluginldr.cpp.

299 {
300  m_error.clear();
301 
302  if( m_fileName.empty() )
303  return false;
304 
305  wxString fname = m_fileName;
306 
307  return Open( fname );
308 }
std::string m_error
Definition: pluginldr.h:73
wxString m_fileName
Definition: pluginldr.h:69
virtual bool Open(const wxString &aFullFileName)=0
Function Open opens a plugin of the given class, performs version compatibility checks,...

References m_error, m_fileName, and Open().

Referenced by KICAD_PLUGIN_LDR_3D::CanRender(), CheckClassVersion(), GetClassVersion(), KICAD_PLUGIN_LDR_3D::GetFileFilter(), GetKicadPluginClass(), GetKicadPluginName(), KICAD_PLUGIN_LDR_3D::GetModelExtension(), KICAD_PLUGIN_LDR_3D::GetNExtensions(), KICAD_PLUGIN_LDR_3D::GetNFilters(), GetVersion(), and KICAD_PLUGIN_LDR_3D::Load().

Member Data Documentation

◆ m_checkClassVersion

CHECK_CLASS_VERSION KICAD_PLUGIN_LDR::m_checkClassVersion
private

Definition at line 65 of file pluginldr.h.

Referenced by CheckClassVersion(), close(), GetClassVersion(), KICAD_PLUGIN_LDR(), and open().

◆ m_error

◆ m_fileName

wxString KICAD_PLUGIN_LDR::m_fileName
private

Definition at line 69 of file pluginldr.h.

Referenced by open(), and reopen().

◆ m_getClassVersion

GET_CLASS_VERSION KICAD_PLUGIN_LDR::m_getClassVersion
private

Definition at line 64 of file pluginldr.h.

Referenced by close(), GetClassVersion(), KICAD_PLUGIN_LDR(), and open().

◆ m_getPluginClass

GET_PLUGIN_CLASS KICAD_PLUGIN_LDR::m_getPluginClass
private

Definition at line 63 of file pluginldr.h.

Referenced by close(), GetKicadPluginClass(), KICAD_PLUGIN_LDR(), and open().

◆ m_getPluginName

GET_PLUGIN_NAME KICAD_PLUGIN_LDR::m_getPluginName
private

Definition at line 66 of file pluginldr.h.

Referenced by close(), GetKicadPluginName(), KICAD_PLUGIN_LDR(), and open().

◆ m_getVersion

GET_VERSION KICAD_PLUGIN_LDR::m_getVersion
private

Definition at line 67 of file pluginldr.h.

Referenced by close(), GetVersion(), KICAD_PLUGIN_LDR(), and open().

◆ m_pluginInfo

std::string KICAD_PLUGIN_LDR::m_pluginInfo
private

Definition at line 70 of file pluginldr.h.

Referenced by GetPluginInfo(), and open().

◆ m_PluginLoader

wxDynamicLibrary KICAD_PLUGIN_LDR::m_PluginLoader
protected

Definition at line 96 of file pluginldr.h.

Referenced by close(), and open().

◆ ok

bool KICAD_PLUGIN_LDR::ok
private

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