]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/include/lldb/Core/ConnectionSharedMemory.h
Merge ^/head r293036 through r293174.
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / include / lldb / Core / ConnectionSharedMemory.h
1 //===-- ConnectionSharedMemory.h --------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #ifndef liblldb_ConnectionSharedMemory_h_
11 #define liblldb_ConnectionSharedMemory_h_
12
13 // C Includes
14 // C++ Includes
15 #include <string>
16
17 // Other libraries and framework includes
18 // Project includes
19 #include "lldb/Core/Connection.h"
20 #include "lldb/Core/DataBufferMemoryMap.h"
21
22 namespace lldb_private {
23
24 class ConnectionSharedMemory :
25     public Connection
26 {
27 public:
28
29     ConnectionSharedMemory ();
30
31     ~ConnectionSharedMemory () override;
32
33     bool
34     IsConnected () const override;
35
36     virtual lldb::ConnectionStatus
37     BytesAvailable (uint32_t timeout_usec, Error *error_ptr);
38
39     lldb::ConnectionStatus
40     Connect (const char *s, Error *error_ptr) override;
41
42     lldb::ConnectionStatus
43     Disconnect (Error *error_ptr) override;
44
45     size_t
46     Read (void *dst, 
47           size_t dst_len, 
48           uint32_t timeout_usec,
49           lldb::ConnectionStatus &status, 
50           Error *error_ptr) override;
51
52     size_t
53     Write (const void *src, size_t src_len, lldb::ConnectionStatus &status, Error *error_ptr) override;
54
55     std::string
56     GetURI() override;
57
58     lldb::ConnectionStatus
59     Open (bool create, const char *name, size_t size, Error *error_ptr);
60
61 protected:
62
63     std::string m_name;
64     int m_fd;    // One buffer that contains all we need
65     DataBufferMemoryMap m_mmap;
66
67 private:
68
69     DISALLOW_COPY_AND_ASSIGN (ConnectionSharedMemory);
70 };
71
72 } // namespace lldb_private
73
74 #endif // liblldb_ConnectionSharedMemory_h_