2022-03-27 18:32:13 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
|
2023-08-13 15:47:51 +01:00
|
|
|
namespace DebugServer
|
2022-03-27 18:32:13 +01:00
|
|
|
{
|
2022-04-03 17:00:40 +01:00
|
|
|
/**
|
|
|
|
|
* Every debug server must implement this interface.
|
|
|
|
|
*
|
|
|
|
|
* See documentation in src/DebugServer/README.md for more.
|
|
|
|
|
*/
|
2022-03-27 18:32:13 +01:00
|
|
|
class ServerInterface
|
|
|
|
|
{
|
|
|
|
|
public:
|
2022-07-11 20:26:42 +01:00
|
|
|
virtual ~ServerInterface() = default;
|
|
|
|
|
|
2022-03-27 18:32:13 +01:00
|
|
|
/**
|
|
|
|
|
* Should return the name of the server.
|
|
|
|
|
*
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
[[nodiscard]] virtual std::string getName() const = 0;
|
|
|
|
|
|
|
|
|
|
/**
|
2022-08-27 17:56:55 +01:00
|
|
|
* Called on start up of the DebugServerComponent. The server should implement any initialisation work here.
|
2022-03-27 18:32:13 +01:00
|
|
|
*/
|
|
|
|
|
virtual void init() = 0;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Called repeatedly in an infinite loop when the DebugServerComponent is running. The server should serve
|
|
|
|
|
* from here.
|
|
|
|
|
*
|
2022-03-31 21:41:03 +01:00
|
|
|
* For servicing DebugServer events, the implementation should either service them here or return from here
|
|
|
|
|
* upon an event being triggered. Returning from this function will allow DebugServerComponent::run() to
|
|
|
|
|
* process any pending events. See the DebugServer documentation in src/DebugServer/README.md for more.
|
2022-03-27 18:32:13 +01:00
|
|
|
*/
|
|
|
|
|
virtual void run() = 0;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Called on shutdown of the DebugServerComponent.
|
|
|
|
|
*/
|
|
|
|
|
virtual void close() = 0;
|
|
|
|
|
};
|
|
|
|
|
}
|