9#ifndef LLDB_UTILITY_LISTENER_H
10#define LLDB_UTILITY_LISTENER_H
17#include <condition_variable>
35class Listener :
public std::enable_shared_from_this<Listener> {
73 void *callback_user_data);
82 uint32_t event_type_mask);
91 uint32_t event_type_mask,
110 std::owner_less<Broadcaster::BroadcasterImplWP>>
113 typedef std::vector<lldb::BroadcasterManagerWP>
An event broadcasting class.
std::weak_ptr< BroadcasterImpl > BroadcasterImplWP
size_t HandleBroadcastEvent(lldb::EventSP &event_sp)
static lldb::ListenerSP MakeListener(const char *name)
event_collection m_events
Event * PeekAtNextEventForBroadcaster(Broadcaster *broadcaster)
Event * PeekAtNextEvent()
uint32_t StartListeningForEvents(Broadcaster *broadcaster, uint32_t event_mask)
std::condition_variable m_events_condition
uint32_t StartListeningForEventSpec(const lldb::BroadcasterManagerSP &manager_sp, const BroadcastEventSpec &event_spec)
bool StopListeningForEventSpec(const lldb::BroadcasterManagerSP &manager_sp, const BroadcastEventSpec &event_spec)
bool(* HandleBroadcastCallback)(lldb::EventSP &event_sp, void *baton)
std::mutex m_broadcasters_mutex
broadcaster_manager_collection m_broadcaster_managers
std::multimap< Broadcaster::BroadcasterImplWP, BroadcasterInfo, std::owner_less< Broadcaster::BroadcasterImplWP > > broadcaster_collection
bool GetEventForBroadcaster(Broadcaster *broadcaster, lldb::EventSP &event_sp, const Timeout< std::micro > &timeout)
bool FindNextEventInternal(std::unique_lock< std::mutex > &lock, Broadcaster *broadcaster, uint32_t event_type_mask, lldb::EventSP &event_sp, bool remove)
std::vector< lldb::BroadcasterManagerWP > broadcaster_manager_collection
Event * PeekAtNextEventForBroadcasterWithType(Broadcaster *broadcaster, uint32_t event_type_mask)
bool StopListeningForEvents(Broadcaster *broadcaster, uint32_t event_mask)
bool GetEventForBroadcasterWithType(Broadcaster *broadcaster, uint32_t event_type_mask, lldb::EventSP &event_sp, const Timeout< std::micro > &timeout)
std::list< lldb::EventSP > event_collection
const Listener & operator=(const Listener &)=delete
Listener(const Listener &)=delete
void BroadcasterWillDestruct(Broadcaster *)
void BroadcasterManagerWillDestruct(lldb::BroadcasterManagerSP manager_sp)
broadcaster_collection m_broadcasters
bool GetEventInternal(const Timeout< std::micro > &timeout, Broadcaster *broadcaster, uint32_t event_type_mask, lldb::EventSP &event_sp)
std::mutex m_events_mutex
void AddEvent(lldb::EventSP &event)
bool GetEvent(lldb::EventSP &event_sp, const Timeout< std::micro > &timeout)
A class that represents a running process on the host machine.
std::shared_ptr< lldb_private::BroadcasterManager > BroadcasterManagerSP
std::shared_ptr< lldb_private::Event > EventSP
std::shared_ptr< lldb_private::Listener > ListenerSP
void * callback_user_data
HandleBroadcastCallback callback
BroadcasterInfo(uint32_t mask, HandleBroadcastCallback cb=nullptr, void *ud=nullptr)