LLDB mainline
ConnectionGenericFileWindows.h
Go to the documentation of this file.
1//===-- ConnectionGenericFileWindows.h --------------------------*- C++ -*-===//
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-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef liblldb_Host_windows_ConnectionGenericFileWindows_h_
10#define liblldb_Host_windows_ConnectionGenericFileWindows_h_
11
14#include "lldb/lldb-types.h"
15
16namespace lldb_private {
17
18class Status;
19
21public:
23
24 ConnectionGenericFile(lldb::file_t file, bool owns_file);
25
26 ~ConnectionGenericFile() override;
27
28 bool IsConnected() const override;
29
30 lldb::ConnectionStatus Connect(llvm::StringRef s, Status *error_ptr) override;
31
32 lldb::ConnectionStatus Disconnect(Status *error_ptr) override;
33
34 size_t Read(void *dst, size_t dst_len, const Timeout<std::micro> &timeout,
35 lldb::ConnectionStatus &status, Status *error_ptr) override;
36
37 size_t Write(const void *src, size_t src_len, lldb::ConnectionStatus &status,
38 Status *error_ptr) override;
39
40 std::string GetURI() override;
41
42 bool InterruptRead() override;
43
44protected:
45 OVERLAPPED m_overlapped;
46 HANDLE m_file;
47 HANDLE m_event_handles[2];
49 LARGE_INTEGER m_file_position;
50
52
53private:
55 void IncrementFilePointer(DWORD amount);
56
57 std::string m_uri;
58
62};
63}
64
65#endif
const ConnectionGenericFile & operator=(const ConnectionGenericFile &)=delete
lldb::ConnectionStatus Disconnect(Status *error_ptr) override
Disconnect the communications connection if one is currently connected.
lldb::ConnectionStatus Connect(llvm::StringRef s, Status *error_ptr) override
Connect using the connect string url.
size_t Write(const void *src, size_t src_len, lldb::ConnectionStatus &status, Status *error_ptr) override
The actual write function that attempts to write to the communications protocol.
size_t Read(void *dst, size_t dst_len, const Timeout< std::micro > &timeout, lldb::ConnectionStatus &status, Status *error_ptr) override
The read function that attempts to read from the connection.
bool IsConnected() const override
Check if the connection is valid.
ConnectionGenericFile(const ConnectionGenericFile &)=delete
bool InterruptRead() override
Interrupts an ongoing Read() operation.
std::string GetURI() override
Returns a URI that describes this connection object.
A communication connection class.
Definition: Connection.h:41
An error handling class.
Definition: Status.h:115
A class that represents a running process on the host machine.
int file_t
Definition: lldb-types.h:59
ConnectionStatus
Connection Status Types.