52 lines · c
1//===-- Transport.h -------------------------------------------------------===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8//9// Debug Adapter Protocol transport layer for encoding and decoding protocol10// messages.11//12//===----------------------------------------------------------------------===//13 14#ifndef LLDB_TOOLS_LLDB_DAP_TRANSPORT_H15#define LLDB_TOOLS_LLDB_DAP_TRANSPORT_H16 17#include "DAPForward.h"18#include "Protocol/ProtocolBase.h"19#include "lldb/Host/JSONTransport.h"20#include "lldb/lldb-forward.h"21#include "llvm/ADT/StringRef.h"22 23namespace lldb_dap {24 25struct ProtocolDescriptor {26 using Id = protocol::Id;27 using Req = protocol::Request;28 using Resp = protocol::Response;29 using Evt = protocol::Event;30};31 32/// A transport class that performs the Debug Adapter Protocol communication33/// with the client.34class Transport final35 : public lldb_private::transport::HTTPDelimitedJSONTransport<36 ProtocolDescriptor> {37public:38 Transport(llvm::StringRef client_name, lldb_dap::Log *log,39 lldb::IOObjectSP input, lldb::IOObjectSP output);40 virtual ~Transport() = default;41 42 void Log(llvm::StringRef message) override;43 44private:45 llvm::StringRef m_client_name;46 lldb_dap::Log *m_log;47};48 49} // namespace lldb_dap50 51#endif52