|
LLDB mainline
|
#include <MainLoopBase.h>
Classes | |
| class | ReadHandle |
Public Types | |
| using | TimePoint |
| typedef std::unique_ptr< ReadHandle > | ReadHandleUP |
| typedef std::function< void(MainLoopBase &)> | Callback |
Public Member Functions | |
| MainLoopBase () | |
| virtual | ~MainLoopBase ()=default |
| virtual ReadHandleUP | RegisterReadObject (const lldb::IOObjectSP &object_sp, const Callback &callback, Status &error)=0 |
| bool | AddPendingCallback (const Callback &callback) |
| bool | AddCallback (const Callback &callback, std::chrono::nanoseconds delay) |
| bool | AddCallback (const Callback &callback, TimePoint point) |
| virtual Status | Run () |
| virtual void | RequestTermination () |
Protected Member Functions | |
| ReadHandleUP | CreateReadHandle (const lldb::IOObjectSP &object_sp) |
| virtual void | UnregisterReadObject (IOObject::WaitableHandle handle)=0 |
| virtual bool | Interrupt ()=0 |
| Interrupt the loop that is currently waiting for events. | |
| void | ProcessCallbacks () |
| std::optional< TimePoint > | GetNextWakeupTime () |
Protected Attributes | |
| std::mutex | m_callback_mutex |
| std::priority_queue< std::pair< TimePoint, Callback >, std::vector< std::pair< TimePoint, Callback > >, llvm::on_first< std::greater< TimePoint > > > | m_callbacks |
| bool | m_terminate_request: 1 |
Private Member Functions | |
| MainLoopBase (const MainLoopBase &)=delete | |
| const MainLoopBase & | operator= (const MainLoopBase &)=delete |
Definition at line 38 of file MainLoopBase.h.
| typedef std::function<void(MainLoopBase &)> lldb_private::MainLoopBase::Callback |
Definition at line 51 of file MainLoopBase.h.
| typedef std::unique_ptr<ReadHandle> lldb_private::MainLoopBase::ReadHandleUP |
Definition at line 49 of file MainLoopBase.h.
Definition at line 43 of file MainLoopBase.h.
|
inline |
Definition at line 46 of file MainLoopBase.h.
References m_terminate_request.
Referenced by MainLoopBase(), lldb_private::MainLoopPosix::MainLoopPosix(), and operator=().
|
virtualdefault |
|
privatedelete |
References MainLoopBase().
|
inline |
Definition at line 70 of file MainLoopBase.h.
References AddCallback().
Referenced by lldb_private::Socket::Accept(), AddCallback(), and AddPendingCallback().
Definition at line 15 of file MainLoopBase.cpp.
References Interrupt(), m_callback_mutex, and m_callbacks.
Definition at line 64 of file MainLoopBase.h.
References AddCallback().
|
inlineprotected |
Definition at line 87 of file MainLoopBase.h.
Referenced by lldb_private::MainLoopPosix::RegisterReadObject(), and lldb_private::MainLoopWindows::RegisterReadObject().
|
protected |
Definition at line 46 of file MainLoopBase.cpp.
References m_callback_mutex, and m_callbacks.
Referenced by lldb_private::MainLoopWindows::Poll().
|
protectedpure virtual |
Interrupt the loop that is currently waiting for events.
Return true if the interrupt succeeded, false if it failed.
Implemented in lldb_private::MainLoopPosix, and lldb_private::MainLoopWindows.
Referenced by AddCallback().
|
privatedelete |
References MainLoopBase().
|
protected |
Definition at line 30 of file MainLoopBase.cpp.
References m_callback_mutex, and m_callbacks.
Referenced by lldb_private::MainLoopPosix::Run(), and lldb_private::MainLoopWindows::Run().
|
pure virtual |
Implemented in lldb_private::MainLoopPosix, and lldb_private::MainLoopWindows.
References error().
Referenced by lldb_private::DomainSocket::Accept(), and lldb_private::TCPSocket::Accept().
|
inlinevirtual |
Definition at line 84 of file MainLoopBase.h.
References m_terminate_request.
Referenced by lldb_private::Socket::Accept(), lldb_private::process_gdb_remote::GDBRemoteCommunicationServerLLGS::HandleInferiorState_Exited(), and lldb_private::mcp::ProtocolServerMCP::Stop().
|
inlinevirtual |
Reimplemented in lldb_private::MainLoopPosix, and lldb_private::MainLoopWindows.
Definition at line 80 of file MainLoopBase.h.
|
protectedpure virtual |
Implemented in lldb_private::MainLoopPosix, and lldb_private::MainLoopWindows.
|
protected |
Definition at line 101 of file MainLoopBase.h.
Referenced by AddCallback(), GetNextWakeupTime(), and ProcessCallbacks().
|
protected |
Definition at line 105 of file MainLoopBase.h.
Referenced by AddCallback(), GetNextWakeupTime(), and ProcessCallbacks().
|
protected |
Definition at line 106 of file MainLoopBase.h.
Referenced by MainLoopBase(), lldb_private::MainLoopPosix::ProcessSignals(), RequestTermination(), lldb_private::MainLoopPosix::Run(), and lldb_private::MainLoopWindows::Run().