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. More... |
Public Types | |
using | Req = typename Proto::Req |
using | Resp = typename Proto::Resp |
using | Evt = typename Proto::Evt |
using | Message = std::variant<Req, Resp, Evt> |
Public Member Functions | |
virtual | ~JSONTransport ()=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. |
Protected Member Functions | |
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.
JSONTransport have limited thread safety requirements:
Definition at line 126 of file JSONTransport.h.
using lldb_private::transport::JSONTransport< Proto >::Evt = typename Proto::Evt |
Definition at line 130 of file JSONTransport.h.
using lldb_private::transport::JSONTransport< Proto >::Message = std::variant<Req, Resp, Evt> |
Definition at line 131 of file JSONTransport.h.
using lldb_private::transport::JSONTransport< Proto >::Req = typename Proto::Req |
Definition at line 128 of file JSONTransport.h.
using lldb_private::transport::JSONTransport< Proto >::Resp = typename Proto::Resp |
Definition at line 129 of file JSONTransport.h.
|
virtualdefault |
|
protectedpure virtual |
Implemented in lldb_protocol::mcp::Transport.
Referenced by lldb_private::transport::JSONTransport< ProtocolDescriptor >::Logv().
|
inlineprotected |
Definition at line 173 of file JSONTransport.h.
Referenced by lldb_private::transport::HTTPDelimitedJSONTransport< Proto >::Parse(), lldb_private::transport::JSONRPCTransport< Proto >::Parse(), and lldb_private::transport::IOTransport< Proto >::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::transport::IOTransport< Proto >.
|
pure virtual |
Sends an event, a message that does not require a response.
|
pure virtual |
Sends a request, a message that expects a response.
|
pure virtual |
Sends a response to a specific request.