Files
BloomPatched/src/DebugServer/ServerInterface.hpp

45 lines
1.3 KiB
C++
Raw Normal View History

#pragma once
#include <string>
namespace DebugServer
{
2022-04-03 17:00:40 +01:00
/**
* Every debug server must implement this interface.
*
* See documentation in src/DebugServer/README.md for more.
*/
class ServerInterface
{
public:
virtual ~ServerInterface() = default;
/**
* 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.
*/
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.
*/
virtual void run() = 0;
/**
* Called on shutdown of the DebugServerComponent.
*/
virtual void close() = 0;
};
}