Created new ServerInterface class and refactored the AVR GDB RSP debug server into an implementation of ServerInterface

This commit is contained in:
Nav
2022-03-27 18:32:13 +01:00
parent 5d3211dc68
commit 934c4b2820
9 changed files with 159 additions and 132 deletions

View File

@@ -0,0 +1,35 @@
#pragma once
#include <string>
namespace Bloom::DebugServers
{
class ServerInterface
{
public:
/**
* Should return the name of the server.
*
* @return
*/
[[nodiscard]] virtual std::string getName() const = 0;
/**
* Called on startup of the DebugServerComponent. The server should implement any initialisation work here.
*/
virtual void init() = 0;
/**
* Called repeatedly in an infinite loop when the DebugServerComponent is running. The server should serve
* from here.
*
* This function should return when any blocking operation is interrupted via an EventNotifier instance.
*/
virtual void run() = 0;
/**
* Called on shutdown of the DebugServerComponent.
*/
virtual void close() = 0;
};
}