LLDB mainline
|
A transport is responsible for maintaining the connection to a client application, and reading/writing structured messages to it. More...
#include <JSONTransport.h>
Classes | |
class | MessageHandler |
Implemented to handle incoming messages. (See Run() below). More... |
Public Types | |
using | Message = std::variant<Req, Resp, Evt> |
using | MessageHandlerSP = std::shared_ptr<MessageHandler> |
Public Member Functions | |
virtual | ~Transport ()=default |
virtual llvm::Error | Send (const Evt &)=0 |
Sends an event, a message that does not require a response. | |
virtual llvm::Error | Send (const Req &)=0 |
Sends a request, a message that expects a response. | |
virtual llvm::Error | Send (const Resp &)=0 |
Sends a response to a specific request. | |
virtual llvm::Expected< MainLoop::ReadHandleUP > | RegisterMessageHandler (MainLoop &loop, MessageHandler &handler)=0 |
RegisterMessageHandler registers the Transport with the given MainLoop and handles any incoming messages using the given MessageHandler. | |
template<typename... Ts> | |
auto | Logv (const char *Fmt, Ts &&...Vals) |
virtual void | Log (llvm::StringRef message)=0 |
A transport is responsible for maintaining the connection to a client application, and reading/writing structured messages to it.
Transports have limited thread safety requirements:
Definition at line 59 of file JSONTransport.h.
using lldb_private::Transport< Req, Resp, Evt >::Message = std::variant<Req, Resp, Evt> |
Definition at line 61 of file JSONTransport.h.
using lldb_private::Transport< Req, Resp, Evt >::MessageHandlerSP = std::shared_ptr<MessageHandler> |
Definition at line 93 of file JSONTransport.h.
|
virtualdefault |
Reimplemented in lldb_protocol::mcp::Transport.
|
pure virtual |
Implemented in lldb_protocol::mcp::Transport.
Referenced by lldb_private::Transport< Request, Response, Notification >::Logv().
|
inline |
Definition at line 105 of file JSONTransport.h.
Referenced by lldb_private::HTTPDelimitedJSONTransport< Req, Resp, Evt >::Parse(), lldb_private::JSONRPCTransport< Req, Resp, Evt >::Parse(), and lldb_private::JSONTransport< Req, Resp, Evt >::Write().
|
pure virtual |
RegisterMessageHandler registers the Transport with the given MainLoop and handles any incoming messages using the given MessageHandler.
If an unexpected error occurs, the MainLoop will be terminated and a log message will include additional information about the termination reason.
Implemented in lldb_private::JSONTransport< Req, Resp, Evt >.
|
pure virtual |
Sends an event, a message that does not require a response.
Implemented in lldb_private::JSONTransport< Req, Resp, Evt >, and lldb_private::JSONTransport< Request, Response, Notification >.
|
pure virtual |
Sends a request, a message that expects a response.
Implemented in lldb_private::JSONTransport< Req, Resp, Evt >.
|
pure virtual |
Sends a response to a specific request.
Implemented in lldb_private::JSONTransport< Req, Resp, Evt >.