9#ifndef LLDB_UTILITY_CONNECTION_H
10#define LLDB_UTILITY_CONNECTION_H
16#include "llvm/ADT/StringRef.h"
25template <
typename Ratio>
class Timeout;
118 virtual size_t Read(
void *dst,
size_t dst_len,
142 virtual size_t Write(
const void *dst,
size_t dst_len,
A communication connection class.
virtual ~Connection()
Virtual destructor since this class gets subclassed and handed to a Communication object.
virtual size_t Read(void *dst, size_t dst_len, const Timeout< std::micro > &timeout, lldb::ConnectionStatus &status, Status *error_ptr)=0
The read function that attempts to read from the connection.
virtual lldb::IOObjectSP GetReadObject()
Returns the underlying IOObject used by the Connection.
Connection()=default
Default constructor.
virtual size_t Write(const void *dst, size_t dst_len, lldb::ConnectionStatus &status, Status *error_ptr)=0
The actual write function that attempts to write to the communications protocol.
virtual lldb::ConnectionStatus Connect(llvm::StringRef url, Status *error_ptr)=0
Connect using the connect string url.
const Connection & operator=(const Connection &)=delete
virtual bool IsConnected() const =0
Check if the connection is valid.
Connection(const Connection &)=delete
virtual lldb::ConnectionStatus Disconnect(Status *error_ptr)=0
Disconnect the communications connection if one is currently connected.
virtual std::string GetURI()=0
Returns a URI that describes this connection object.
virtual bool InterruptRead()=0
Interrupts an ongoing Read() operation.
A class that represents a running process on the host machine.
std::shared_ptr< lldb_private::IOObject > IOObjectSP
ConnectionStatus
Connection Status Types.