|
KiCad PCB EDA Suite
|
Manager for caching loaded boards in memory, to avoid repeatedly loading and parsing the same board. More...
#include <board_test_utils.h>
Public Member Functions | |
| BOARD * | LoadAndCache (const std::string &aFilePath, REPORTER *aReporter) |
| Load (or reload) board for the given file path and send the load messages to the given reporter. | |
| BOARD * | GetCachedBoard (const std::string &aFilePath) |
| Get a cached board for the given file path, or load it if not already cached, without forcing a reload. | |
Protected Member Functions | |
| BOARD * | getCachedBoard (PCB_IO &aIoPlugin, const std::string &aFilePath, bool aForceReload, REPORTER *aReporter) |
| virtual BOARD * | getCachedBoard (const std::string &aFilePath, bool aForceReload, REPORTER *aReporter)=0 |
| Implementation of the board loader (probably plug in the PCB_IO plugin here) | |
Private Attributes | |
| std::map< std::string, std::unique_ptr< BOARD > > | m_boardCache |
Manager for caching loaded boards in memory, to avoid repeatedly loading and parsing the same board.
Generally, you might want to use a singleton instance of this class for each PCB_IO plugin.
This class can learn additional features such as load profiling, or cache eviction policies.
Definition at line 320 of file board_test_utils.h.
| BOARD * KI_TEST::CACHED_BOARD_LOADER::GetCachedBoard | ( | const std::string & | aFilePath | ) |
Get a cached board for the given file path, or load it if not already cached, without forcing a reload.
Definition at line 877 of file board_test_utils.cpp.
References getCachedBoard().
Referenced by ALLEGRO_COMPREHENSIVE_FIXTURE::GetCachedBoard(), and RunBoardExpectations().
|
protectedpure virtual |
Implementation of the board loader (probably plug in the PCB_IO plugin here)
Implemented in KI_TEST::ALLEGRO_CACHED_LOADER.
|
protected |
Definition at line 889 of file board_test_utils.cpp.
References KI_TEST::LoadBoardWithCapture(), and m_boardCache.
Referenced by GetCachedBoard(), KI_TEST::ALLEGRO_CACHED_LOADER::getCachedBoard(), and LoadAndCache().
| BOARD * KI_TEST::CACHED_BOARD_LOADER::LoadAndCache | ( | const std::string & | aFilePath, |
| REPORTER * | aReporter ) |
Load (or reload) board for the given file path and send the load messages to the given reporter.
| aFilePath | the file path to load |
| aReporter | the reporter to capture load messages, or nullptr to ignore messages |
Definition at line 883 of file board_test_utils.cpp.
References getCachedBoard().
Referenced by RunBoardLoad().
|
private |
Definition at line 347 of file board_test_utils.h.
Referenced by getCachedBoard().