|
KiCad PCB EDA Suite
|
Singleton class to load Allegro boards and cache them in memory, to avoid repeatedly loading and parsing the same board files for multiple tests. More...
#include <allegro_test_utils.h>
Public Member Functions | |
| ~ALLEGRO_CACHED_LOADER () | |
| 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. | |
Static Public Member Functions | |
| static ALLEGRO_CACHED_LOADER & | GetInstance () |
| Get the singleton instance of the Allegro board cache loader. | |
Protected Member Functions | |
| BOARD * | getCachedBoard (const std::string &aFilePath, bool aForceReload, REPORTER *aReporter) override |
| Implementation of CACHED_BOARD_LOADER interface with our Allegro PCB_IO plugin. | |
| BOARD * | getCachedBoard (PCB_IO &aIoPlugin, const std::string &aFilePath, bool aForceReload, REPORTER *aReporter) |
Private Member Functions | |
| ALLEGRO_CACHED_LOADER () | |
Private Attributes | |
| std::unique_ptr< PCB_IO_ALLEGRO > | m_allegroPlugin |
| std::map< std::string, std::unique_ptr< BOARD > > | m_boardCache |
Singleton class to load Allegro boards and cache them in memory, to avoid repeatedly loading and parsing the same board files for multiple tests.
Definition at line 34 of file allegro_test_utils.h.
| KI_TEST::ALLEGRO_CACHED_LOADER::~ALLEGRO_CACHED_LOADER | ( | ) |
Definition at line 68 of file allegro_test_utils.cpp.
|
private |
Definition at line 62 of file allegro_test_utils.cpp.
References m_allegroPlugin.
Referenced by GetInstance().
|
inherited |
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().
|
overrideprotectedvirtual |
Implementation of CACHED_BOARD_LOADER interface with our Allegro PCB_IO plugin.
Implements KI_TEST::CACHED_BOARD_LOADER.
Definition at line 80 of file allegro_test_utils.cpp.
References KI_TEST::CACHED_BOARD_LOADER::getCachedBoard(), and m_allegroPlugin.
|
protectedinherited |
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().
|
static |
Get the singleton instance of the Allegro board cache loader.
Definition at line 73 of file allegro_test_utils.cpp.
References ALLEGRO_CACHED_LOADER().
Referenced by ALLEGRO_COMPREHENSIVE_FIXTURE::GetCachedBoard(), RunBoardExpectations(), and RunBoardLoad().
|
inherited |
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 53 of file allegro_test_utils.h.
Referenced by ALLEGRO_CACHED_LOADER(), and getCachedBoard().
|
privateinherited |
Definition at line 347 of file board_test_utils.h.
Referenced by getCachedBoard().