Improved handling of late initialisation for component objects

This commit is contained in:
Nav
2021-12-31 19:45:15 +00:00
parent d24587b992
commit 49383eb448
9 changed files with 109 additions and 72 deletions

View File

@@ -28,21 +28,19 @@ namespace Bloom::DebugServers
class DebugServer: public Thread
{
public:
explicit DebugServer(EventManager& eventManager): eventManager(eventManager) {};
explicit DebugServer(
EventManager& eventManager,
const ProjectConfig& projectConfig,
const EnvironmentConfig& environmentConfig,
const DebugServerConfig& debugServerConfig
):
eventManager(eventManager),
projectConfig(projectConfig),
environmentConfig(environmentConfig),
debugServerConfig(debugServerConfig) {};
virtual ~DebugServer() = default;
void setProjectConfig(const ProjectConfig& projectConfig) {
this->projectConfig = projectConfig;
}
void setEnvironmentConfig(const EnvironmentConfig& environmentConfig) {
this->environmentConfig = environmentConfig;
}
void setDebugServerConfig(const DebugServerConfig& debugServerConfig) {
this->debugServerConfig = debugServerConfig;
}
/**
* Entry point for the DebugServer. This must called from a dedicated thread.
*/

View File

@@ -26,7 +26,12 @@ namespace Bloom::DebugServers::Gdb
class AvrGdbRsp: public GdbRspDebugServer
{
public:
explicit AvrGdbRsp(EventManager& eventManager): GdbRspDebugServer(eventManager) {};
explicit AvrGdbRsp(
EventManager& eventManager,
const ProjectConfig& projectConfig,
const EnvironmentConfig& environmentConfig,
const DebugServerConfig& debugServerConfig
): GdbRspDebugServer(eventManager, projectConfig, environmentConfig, debugServerConfig) {};
std::string getName() const override {
return "AVR GDB Remote Serial Protocol Debug Server";

View File

@@ -36,7 +36,12 @@ namespace Bloom::DebugServers::Gdb
class GdbRspDebugServer: public DebugServer
{
public:
explicit GdbRspDebugServer(EventManager& eventManager): DebugServer(eventManager) {};
explicit GdbRspDebugServer(
EventManager& eventManager,
const ProjectConfig& projectConfig,
const EnvironmentConfig& environmentConfig,
const DebugServerConfig& debugServerConfig
): DebugServer(eventManager, projectConfig, environmentConfig, debugServerConfig) {};
std::string getName() const override {
return "GDB Remote Serial Protocol DebugServer";