|
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::Error | ReplyWithParseError (llvm::StringRef raw_message, llvm::StringRef reason) |
Sends an error response for a message that failed to parse, described by reason. | |
| virtual llvm::Error | RegisterMessageHandler (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 147 of file JSONTransport.h.
| using lldb_private::transport::JSONTransport< Proto >::Evt = typename Proto::Evt |
Definition at line 151 of file JSONTransport.h.
| using lldb_private::transport::JSONTransport< Proto >::Message = std::variant<Req, Resp, Evt> |
Definition at line 152 of file JSONTransport.h.
| using lldb_private::transport::JSONTransport< Proto >::Req = typename Proto::Req |
Definition at line 149 of file JSONTransport.h.
| using lldb_private::transport::JSONTransport< Proto >::Resp = typename Proto::Resp |
Definition at line 150 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 201 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 >.
|
inlinevirtual |
Sends an error response for a message that failed to parse, described by reason.
Sends nothing if no request id can be recovered from it, since there is then no request to respond to.
Reimplemented in lldb_protocol::mcp::Transport.
Definition at line 166 of file JSONTransport.h.
Referenced by lldb_private::transport::IOTransport< Proto >::OnRead().
|
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.