003 File Manager
Current Path:
/usr/src/contrib/llvm-project/lldb/include/lldb/Host
usr
/
src
/
contrib
/
llvm-project
/
lldb
/
include
/
lldb
/
Host
/
📁
..
📄
Config.h.cmake
(1.2 KB)
📄
ConnectionFileDescriptor.h
(528 B)
📄
Debug.h
(4.44 KB)
📄
Editline.h
(12.4 KB)
📄
File.h
(15.26 KB)
📄
FileAction.h
(1.35 KB)
📄
FileCache.h
(1.29 KB)
📄
FileSystem.h
(6.84 KB)
📄
Host.h
(10.04 KB)
📄
HostGetOpt.h
(699 B)
📄
HostInfo.h
(2.6 KB)
📄
HostInfoBase.h
(4.05 KB)
📄
HostNativeProcess.h
(728 B)
📄
HostNativeProcessBase.h
(1.43 KB)
📄
HostNativeThread.h
(690 B)
📄
HostNativeThreadBase.h
(1.46 KB)
📄
HostNativeThreadForward.h
(753 B)
📄
HostProcess.h
(1.7 KB)
📄
HostThread.h
(1.32 KB)
📄
LZMA.h
(883 B)
📄
LockFile.h
(704 B)
📄
LockFileBase.h
(1.52 KB)
📄
MainLoop.h
(3.83 KB)
📄
MainLoopBase.h
(2.91 KB)
📄
MonitoringProcessLauncher.h
(1.12 KB)
📄
OptionParser.h
(1.51 KB)
📄
Pipe.h
(668 B)
📄
PipeBase.h
(2.26 KB)
📄
PosixApi.h
(743 B)
📄
ProcessLaunchInfo.h
(5.36 KB)
📄
ProcessLauncher.h
(735 B)
📄
ProcessRunLock.h
(2.02 KB)
📄
PseudoTerminal.h
(8.45 KB)
📄
SafeMachO.h
(3.25 KB)
📄
Socket.h
(4.56 KB)
📄
SocketAddress.h
(5.77 KB)
📄
StringConvert.h
(1.26 KB)
📄
Terminal.h
(5.12 KB)
📄
ThreadLauncher.h
(1.39 KB)
📄
Time.h
(718 B)
📄
XML.h
(4.7 KB)
📁
common
📁
freebsd
📁
netbsd
📁
openbsd
📁
posix
Editing: MainLoopBase.h
//===-- MainLoopBase.h ------------------------------------------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #ifndef LLDB_HOST_MAINLOOPBASE_H #define LLDB_HOST_MAINLOOPBASE_H #include "lldb/Utility/IOObject.h" #include "lldb/Utility/Status.h" #include "llvm/Support/ErrorHandling.h" #include <functional> namespace lldb_private { // The purpose of this class is to enable multiplexed processing of data from // different sources without resorting to multi-threading. Clients can register // IOObjects, which will be monitored for readability, and when they become // ready, the specified callback will be invoked. Monitoring for writability is // not supported, but can be easily added if needed. // // The RegisterReadObject function return a handle, which controls the duration // of the monitoring. When this handle is destroyed, the callback is // deregistered. // // This class simply defines the interface common for all platforms, actual // implementations are platform-specific. class MainLoopBase { private: class ReadHandle; public: MainLoopBase() {} virtual ~MainLoopBase() {} typedef std::unique_ptr<ReadHandle> ReadHandleUP; typedef std::function<void(MainLoopBase &)> Callback; virtual ReadHandleUP RegisterReadObject(const lldb::IOObjectSP &object_sp, const Callback &callback, Status &error) { llvm_unreachable("Not implemented"); } // Waits for registered events and invoke the proper callbacks. Returns when // all callbacks deregister themselves or when someone requests termination. virtual Status Run() { llvm_unreachable("Not implemented"); } // Requests the exit of the Run() function. virtual void RequestTermination() { llvm_unreachable("Not implemented"); } protected: ReadHandleUP CreateReadHandle(const lldb::IOObjectSP &object_sp) { return ReadHandleUP(new ReadHandle(*this, object_sp->GetWaitableHandle())); } virtual void UnregisterReadObject(IOObject::WaitableHandle handle) { llvm_unreachable("Not implemented"); } private: class ReadHandle { public: ~ReadHandle() { m_mainloop.UnregisterReadObject(m_handle); } private: ReadHandle(MainLoopBase &mainloop, IOObject::WaitableHandle handle) : m_mainloop(mainloop), m_handle(handle) {} MainLoopBase &m_mainloop; IOObject::WaitableHandle m_handle; friend class MainLoopBase; ReadHandle(const ReadHandle &) = delete; const ReadHandle &operator=(const ReadHandle &) = delete; }; MainLoopBase(const MainLoopBase &) = delete; const MainLoopBase &operator=(const MainLoopBase &) = delete; }; } // namespace lldb_private #endif // LLDB_HOST_MAINLOOPBASE_H
Upload File
Create Folder