Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
de4cceb2
Commit
de4cceb2
authored
Sep 22, 2013
by
Dick Hollenbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
unique FPL_CACHE class names
parent
153aee8e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
19 deletions
+19
-19
legacy_plugin.cpp
pcbnew/legacy_plugin.cpp
+16
-16
legacy_plugin.h
pcbnew/legacy_plugin.h
+3
-3
No files found.
pcbnew/legacy_plugin.cpp
View file @
de4cceb2
...
...
@@ -3872,7 +3872,7 @@ void LEGACY_PLUGIN::savePCB_TEXT( const TEXTE_PCB* me ) const
would have to re-read the file when searching for any MODULE, and this would
be very problematic filling a FOOTPRINT_LIST via this PLUGIN API. If memory
becomes a concern, consider the cache lifetime policy, which determines the
time that a
FPL
_CACHE is in RAM. Note PLUGIN lifetime also plays a role in
time that a
LP
_CACHE is in RAM. Note PLUGIN lifetime also plays a role in
cache lifetime.
*/
...
...
@@ -3887,12 +3887,12 @@ typedef MODULE_MAP::const_iterator MODULE_CITER;
/**
* Class
FPL
_CACHE
* Class
LP
_CACHE
* assists only for the footprint portion of the PLUGIN API, and only for the
* LEGACY_PLUGIN, so therefore is private to this implementation file, i.e. not placed
* into a header.
*/
struct
FPL
_CACHE
struct
LP
_CACHE
{
LEGACY_PLUGIN
*
m_owner
;
// my owner, I need its LEGACY_PLUGIN::LoadMODULE()
wxString
m_lib_path
;
...
...
@@ -3900,7 +3900,7 @@ struct FPL_CACHE
MODULE_MAP
m_modules
;
// map or tuple of footprint_name vs. MODULE*
bool
m_writable
;
FPL
_CACHE
(
LEGACY_PLUGIN
*
aOwner
,
const
wxString
&
aLibraryPath
);
LP
_CACHE
(
LEGACY_PLUGIN
*
aOwner
,
const
wxString
&
aLibraryPath
);
// Most all functions in this class throw IO_ERROR exceptions. There are no
// error codes nor user interface calls from here, nor in any PLUGIN.
...
...
@@ -3932,7 +3932,7 @@ struct FPL_CACHE
};
FPL_CACHE
::
FPL
_CACHE
(
LEGACY_PLUGIN
*
aOwner
,
const
wxString
&
aLibraryPath
)
:
LP_CACHE
::
LP
_CACHE
(
LEGACY_PLUGIN
*
aOwner
,
const
wxString
&
aLibraryPath
)
:
m_owner
(
aOwner
),
m_lib_path
(
aLibraryPath
),
m_writable
(
true
)
...
...
@@ -3940,7 +3940,7 @@ FPL_CACHE::FPL_CACHE( LEGACY_PLUGIN* aOwner, const wxString& aLibraryPath ) :
}
wxDateTime
FPL
_CACHE
::
GetLibModificationTime
()
wxDateTime
LP
_CACHE
::
GetLibModificationTime
()
{
wxFileName
fn
(
m_lib_path
);
...
...
@@ -3952,7 +3952,7 @@ wxDateTime FPL_CACHE::GetLibModificationTime()
}
void
FPL
_CACHE
::
Load
()
void
LP
_CACHE
::
Load
()
{
FILE_LINE_READER
reader
(
m_lib_path
);
...
...
@@ -3967,7 +3967,7 @@ void FPL_CACHE::Load()
}
void
FPL
_CACHE
::
ReadAndVerifyHeader
(
LINE_READER
*
aReader
)
void
LP
_CACHE
::
ReadAndVerifyHeader
(
LINE_READER
*
aReader
)
{
char
*
line
=
aReader
->
ReadLine
();
...
...
@@ -3999,7 +3999,7 @@ L_bad_library:
}
void
FPL
_CACHE
::
SkipIndex
(
LINE_READER
*
aReader
)
void
LP
_CACHE
::
SkipIndex
(
LINE_READER
*
aReader
)
{
// Some broken INDEX sections have more than one section, due to prior bugs.
// So we must read the next line after $EndINDEX tag,
...
...
@@ -4028,7 +4028,7 @@ void FPL_CACHE::SkipIndex( LINE_READER* aReader )
}
void
FPL
_CACHE
::
LoadModules
(
LINE_READER
*
aReader
)
void
LP
_CACHE
::
LoadModules
(
LINE_READER
*
aReader
)
{
m_owner
->
SetReader
(
aReader
);
...
...
@@ -4122,7 +4122,7 @@ void FPL_CACHE::LoadModules( LINE_READER* aReader )
}
void
FPL
_CACHE
::
Save
()
void
LP
_CACHE
::
Save
()
{
if
(
!
m_writable
)
{
...
...
@@ -4179,7 +4179,7 @@ void FPL_CACHE::Save()
}
void
FPL
_CACHE
::
SaveHeader
(
FILE
*
aFile
)
void
LP
_CACHE
::
SaveHeader
(
FILE
*
aFile
)
{
fprintf
(
aFile
,
"%s %s
\n
"
,
FOOTPRINT_LIBRARY_HEADER
,
TO_UTF8
(
DateAndTime
()
)
);
fprintf
(
aFile
,
"# encoding utf-8
\n
"
);
...
...
@@ -4187,7 +4187,7 @@ void FPL_CACHE::SaveHeader( FILE* aFile )
}
void
FPL
_CACHE
::
SaveIndex
(
FILE
*
aFile
)
void
LP
_CACHE
::
SaveIndex
(
FILE
*
aFile
)
{
fprintf
(
aFile
,
"$INDEX
\n
"
);
...
...
@@ -4200,7 +4200,7 @@ void FPL_CACHE::SaveIndex( FILE* aFile )
}
void
FPL
_CACHE
::
SaveModules
(
FILE
*
aFile
)
void
LP
_CACHE
::
SaveModules
(
FILE
*
aFile
)
{
m_owner
->
SetFilePtr
(
aFile
);
...
...
@@ -4219,7 +4219,7 @@ void LEGACY_PLUGIN::cacheLib( const wxString& aLibraryPath )
{
// a spectacular episode in memory management:
delete
m_cache
;
m_cache
=
new
FPL
_CACHE
(
this
,
aLibraryPath
);
m_cache
=
new
LP
_CACHE
(
this
,
aLibraryPath
);
m_cache
->
Load
();
}
}
...
...
@@ -4360,7 +4360,7 @@ void LEGACY_PLUGIN::FootprintLibCreate( const wxString& aLibraryPath, PROPERTIES
init
(
NULL
);
delete
m_cache
;
m_cache
=
new
FPL
_CACHE
(
this
,
aLibraryPath
);
m_cache
=
new
LP
_CACHE
(
this
,
aLibraryPath
);
m_cache
->
Save
();
m_cache
->
Load
();
// update m_writable and m_mod_time
}
...
...
pcbnew/legacy_plugin.h
View file @
de4cceb2
...
...
@@ -49,7 +49,7 @@ class EDGE_MODULE;
class
TRACK
;
class
SEGZONE
;
class
D_PAD
;
struct
FPL
_CACHE
;
struct
LP
_CACHE
;
/**
...
...
@@ -124,7 +124,7 @@ protected:
wxString
m_field
;
///< reused to stuff MODULE fields.
int
m_loading_format_version
;
///< which BOARD_FORMAT_VERSION am I Load()ing?
FPL_CACHE
*
m_cache
;
LP_CACHE
*
m_cache
;
/// initialize PLUGIN like a constructor would, and futz with fresh BOARD if needed.
void
init
(
PROPERTIES
*
aProperties
);
...
...
@@ -273,7 +273,7 @@ protected:
/// we only cache one footprint library for now, this determines which one.
void
cacheLib
(
const
wxString
&
aLibraryPath
);
friend
struct
FPL
_CACHE
;
friend
struct
LP
_CACHE
;
};
#endif // LEGACY_PLUGIN_H_
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment