KiCad PCB EDA Suite
Loading...
Searching...
No Matches
SCH_IO_LIB_CACHE Class Referenceabstract

A base cache assistant implementation for the symbol library portion of the SCH_IO API. More...

#include <sch_io_lib_cache.h>

Inheritance diagram for SCH_IO_LIB_CACHE:
SCH_IO_ALTIUM_LIB_CACHE SCH_IO_KICAD_LEGACY_LIB_CACHE SCH_IO_KICAD_SEXPR_LIB_CACHE

Public Member Functions

 SCH_IO_LIB_CACHE (const wxString &aLibraryPath)
 
virtual ~SCH_IO_LIB_CACHE ()
 
void IncrementModifyHash ()
 
int GetModifyHash ()
 
virtual void Save (const std::optional< bool > &aOpt=std::nullopt)
 Save the entire library to file m_libFileName;.
 
virtual void Load ()=0
 
virtual void AddSymbol (const LIB_SYMBOL *aSymbol)
 
virtual void DeleteSymbol (const wxString &aName)=0
 
virtual LIB_SYMBOLGetSymbol (const wxString &aName)
 
wxFileName GetRealFile () const
 
wxDateTime GetLibModificationTime ()
 
bool IsFile (const wxString &aFullPathAndFileName) const
 
bool IsFileChanged () const
 
void SetModified (bool aModified=true)
 
wxString GetLogicalName () const
 
void SetFileName (const wxString &aFileName)
 
wxString GetFileName () const
 
const LIB_SYMBOL_MAPGetSymbolMap () const
 

Protected Member Functions

LIB_SYMBOLremoveSymbol (LIB_SYMBOL *aAlias)
 

Protected Attributes

int m_modHash
 
std::mutex m_modHashMutex
 
wxString m_fileName
 
wxFileName m_libFileName
 
wxDateTime m_fileModTime
 
LIB_SYMBOL_MAP m_symbols
 
bool m_isWritable
 
bool m_isModified
 
SCH_LIB_TYPE m_libType
 

Detailed Description

A base cache assistant implementation for the symbol library portion of the SCH_IO API.

Definition at line 40 of file sch_io_lib_cache.h.

Constructor & Destructor Documentation

◆ SCH_IO_LIB_CACHE()

SCH_IO_LIB_CACHE::SCH_IO_LIB_CACHE ( const wxString &  aLibraryPath)

Definition at line 28 of file sch_io_lib_cache.cpp.

References m_libType.

◆ ~SCH_IO_LIB_CACHE()

SCH_IO_LIB_CACHE::~SCH_IO_LIB_CACHE ( )
virtual

Definition at line 39 of file sch_io_lib_cache.cpp.

References m_symbols.

Member Function Documentation

◆ AddSymbol()

void SCH_IO_LIB_CACHE::AddSymbol ( const LIB_SYMBOL aSymbol)
virtual

◆ DeleteSymbol()

virtual void SCH_IO_LIB_CACHE::DeleteSymbol ( const wxString &  aName)
pure virtual

◆ GetFileName()

wxString SCH_IO_LIB_CACHE::GetFileName ( ) const
inline

◆ GetLibModificationTime()

wxDateTime SCH_IO_LIB_CACHE::GetLibModificationTime ( )

◆ GetLogicalName()

wxString SCH_IO_LIB_CACHE::GetLogicalName ( ) const
inline

Definition at line 84 of file sch_io_lib_cache.h.

References m_libFileName.

◆ GetModifyHash()

int SCH_IO_LIB_CACHE::GetModifyHash ( )
inline

◆ GetRealFile()

wxFileName SCH_IO_LIB_CACHE::GetRealFile ( ) const

◆ GetSymbol()

LIB_SYMBOL * SCH_IO_LIB_CACHE::GetSymbol ( const wxString &  aName)
virtual

Definition at line 178 of file sch_io_lib_cache.cpp.

References m_symbols.

Referenced by EESCHEMA_JOBS_HANDLER::JobSymExportSvg().

◆ GetSymbolMap()

const LIB_SYMBOL_MAP & SCH_IO_LIB_CACHE::GetSymbolMap ( ) const
inline

Definition at line 90 of file sch_io_lib_cache.h.

References m_symbols.

Referenced by EESCHEMA_JOBS_HANDLER::JobSymExportSvg().

◆ IncrementModifyHash()

◆ IsFile()

◆ IsFileChanged()

bool SCH_IO_LIB_CACHE::IsFileChanged ( ) const

◆ Load()

virtual void SCH_IO_LIB_CACHE::Load ( )
pure virtual

◆ removeSymbol()

◆ Save()

void SCH_IO_LIB_CACHE::Save ( const std::optional< bool > &  aOpt = std::nullopt)
virtual

Save the entire library to file m_libFileName;.

Reimplemented in SCH_IO_KICAD_LEGACY_LIB_CACHE, and SCH_IO_KICAD_SEXPR_LIB_CACHE.

Definition at line 49 of file sch_io_lib_cache.cpp.

◆ SetFileName()

void SCH_IO_LIB_CACHE::SetFileName ( const wxString &  aFileName)
inline

◆ SetModified()

void SCH_IO_LIB_CACHE::SetModified ( bool  aModified = true)
inline

Member Data Documentation

◆ m_fileModTime

◆ m_fileName

wxString SCH_IO_LIB_CACHE::m_fileName
protected

Definition at line 98 of file sch_io_lib_cache.h.

Referenced by IsFile().

◆ m_isModified

◆ m_isWritable

bool SCH_IO_LIB_CACHE::m_isWritable
protected

Definition at line 102 of file sch_io_lib_cache.h.

Referenced by GetLibModificationTime().

◆ m_libFileName

◆ m_libType

SCH_LIB_TYPE SCH_IO_LIB_CACHE::m_libType
protected

Definition at line 104 of file sch_io_lib_cache.h.

Referenced by SCH_IO_KICAD_LEGACY_LIB_CACHE::Load(), and SCH_IO_LIB_CACHE().

◆ m_modHash

int SCH_IO_LIB_CACHE::m_modHash
protected

Definition at line 95 of file sch_io_lib_cache.h.

Referenced by GetModifyHash(), and IncrementModifyHash().

◆ m_modHashMutex

std::mutex SCH_IO_LIB_CACHE::m_modHashMutex
protected

Definition at line 96 of file sch_io_lib_cache.h.

Referenced by GetModifyHash(), and IncrementModifyHash().

◆ m_symbols


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