LLDB mainline
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | Friends | List of all members
lldb_private::Listener Class Reference

#include <Listener.h>

Inheritance diagram for lldb_private::Listener:
Inheritance graph
[legend]

Classes

struct  BroadcasterInfo
 

Public Types

typedef bool(* HandleBroadcastCallback) (lldb::EventSP &event_sp, void *baton)
 

Public Member Functions

 ~Listener ()
 
void AddEvent (lldb::EventSP &event)
 
void Clear ()
 
const char * GetName ()
 
uint32_t StartListeningForEventSpec (const lldb::BroadcasterManagerSP &manager_sp, const BroadcastEventSpec &event_spec)
 
bool StopListeningForEventSpec (const lldb::BroadcasterManagerSP &manager_sp, const BroadcastEventSpec &event_spec)
 
uint32_t StartListeningForEvents (Broadcaster *broadcaster, uint32_t event_mask)
 
uint32_t StartListeningForEvents (Broadcaster *broadcaster, uint32_t event_mask, HandleBroadcastCallback callback, void *callback_user_data)
 
bool StopListeningForEvents (Broadcaster *broadcaster, uint32_t event_mask)
 
EventPeekAtNextEvent ()
 
EventPeekAtNextEventForBroadcaster (Broadcaster *broadcaster)
 
EventPeekAtNextEventForBroadcasterWithType (Broadcaster *broadcaster, uint32_t event_type_mask)
 
bool GetEvent (lldb::EventSP &event_sp, const Timeout< std::micro > &timeout)
 
bool GetEventForBroadcaster (Broadcaster *broadcaster, lldb::EventSP &event_sp, const Timeout< std::micro > &timeout)
 
bool GetEventForBroadcasterWithType (Broadcaster *broadcaster, uint32_t event_type_mask, lldb::EventSP &event_sp, const Timeout< std::micro > &timeout)
 
size_t HandleBroadcastEvent (lldb::EventSP &event_sp)
 

Static Public Member Functions

static lldb::ListenerSP MakeListener (const char *name)
 

Protected Member Functions

 Listener (const char *name)
 

Private Types

typedef std::multimap< Broadcaster::BroadcasterImplWP, BroadcasterInfo, std::owner_less< Broadcaster::BroadcasterImplWP > > broadcaster_collection
 
typedef std::list< lldb::EventSPevent_collection
 
typedef std::vector< lldb::BroadcasterManagerWPbroadcaster_manager_collection
 

Private Member Functions

bool FindNextEventInternal (std::unique_lock< std::mutex > &lock, Broadcaster *broadcaster, uint32_t event_type_mask, lldb::EventSP &event_sp, bool remove)
 
bool GetEventInternal (const Timeout< std::micro > &timeout, Broadcaster *broadcaster, uint32_t event_type_mask, lldb::EventSP &event_sp)
 
void BroadcasterWillDestruct (Broadcaster *)
 
void BroadcasterManagerWillDestruct (lldb::BroadcasterManagerSP manager_sp)
 
 Listener (const Listener &)=delete
 
const Listeneroperator= (const Listener &)=delete
 

Private Attributes

std::string m_name
 
broadcaster_collection m_broadcasters
 
std::mutex m_broadcasters_mutex
 
event_collection m_events
 
std::mutex m_events_mutex
 
std::condition_variable m_events_condition
 
broadcaster_manager_collection m_broadcaster_managers
 

Friends

class Broadcaster
 
class BroadcasterManager
 

Detailed Description

Definition at line 35 of file Listener.h.

Member Typedef Documentation

◆ broadcaster_collection

Definition at line 111 of file Listener.h.

◆ broadcaster_manager_collection

Definition at line 114 of file Listener.h.

◆ event_collection

Definition at line 112 of file Listener.h.

◆ HandleBroadcastCallback

typedef bool(* lldb_private::Listener::HandleBroadcastCallback) (lldb::EventSP &event_sp, void *baton)

Definition at line 37 of file Listener.h.

Constructor & Destructor Documentation

◆ Listener() [1/2]

Listener::Listener ( const char *  name)
protected

Definition at line 21 of file Listener.cpp.

References lldb_private::GetLog(), LLDB_LOGF, m_name, and lldb_private::Object.

◆ ~Listener()

Listener::~Listener ( )

Definition at line 26 of file Listener.cpp.

References lldb_private::GetLog(), LLDB_LOGF, m_name, and lldb_private::Object.

◆ Listener() [2/2]

lldb_private::Listener::Listener ( const Listener )
privatedelete

Member Function Documentation

◆ AddEvent()

void Listener::AddEvent ( lldb::EventSP event)

◆ BroadcasterManagerWillDestruct()

void Listener::BroadcasterManagerWillDestruct ( lldb::BroadcasterManagerSP  manager_sp)
private

Definition at line 158 of file Listener.cpp.

References m_broadcaster_managers.

◆ BroadcasterWillDestruct()

void Listener::BroadcasterWillDestruct ( Broadcaster broadcaster)
private

◆ Clear()

void Listener::Clear ( )

◆ FindNextEventInternal()

bool Listener::FindNextEventInternal ( std::unique_lock< std::mutex > &  lock,
Broadcaster broadcaster,
uint32_t  event_type_mask,
lldb::EventSP event_sp,
bool  remove 
)
private

◆ GetEvent()

bool Listener::GetEvent ( lldb::EventSP event_sp,
const Timeout< std::micro > &  timeout 
)

Definition at line 308 of file Listener.cpp.

References GetEventInternal().

◆ GetEventForBroadcaster()

bool Listener::GetEventForBroadcaster ( Broadcaster broadcaster,
lldb::EventSP event_sp,
const Timeout< std::micro > &  timeout 
)

Definition at line 302 of file Listener.cpp.

References GetEventInternal().

◆ GetEventForBroadcasterWithType()

bool Listener::GetEventForBroadcasterWithType ( Broadcaster broadcaster,
uint32_t  event_type_mask,
lldb::EventSP event_sp,
const Timeout< std::micro > &  timeout 
)

Definition at line 296 of file Listener.cpp.

References GetEventInternal().

◆ GetEventInternal()

bool Listener::GetEventInternal ( const Timeout< std::micro > &  timeout,
Broadcaster broadcaster,
uint32_t  event_type_mask,
lldb::EventSP event_sp 
)
private

◆ GetName()

const char * lldb_private::Listener::GetName ( )
inline

Definition at line 58 of file Listener.h.

References m_name.

Referenced by FindNextEventInternal().

◆ HandleBroadcastEvent()

size_t Listener::HandleBroadcastEvent ( lldb::EventSP event_sp)

◆ MakeListener()

ListenerSP Listener::MakeListener ( const char *  name)
static

◆ operator=()

const Listener & lldb_private::Listener::operator= ( const Listener )
privatedelete

◆ PeekAtNextEvent()

Event * Listener::PeekAtNextEvent ( )

Definition at line 232 of file Listener.cpp.

References FindNextEventInternal(), and m_events_mutex.

◆ PeekAtNextEventForBroadcaster()

Event * Listener::PeekAtNextEventForBroadcaster ( Broadcaster broadcaster)

Definition at line 240 of file Listener.cpp.

References FindNextEventInternal(), and m_events_mutex.

◆ PeekAtNextEventForBroadcasterWithType()

Event * Listener::PeekAtNextEventForBroadcasterWithType ( Broadcaster broadcaster,
uint32_t  event_type_mask 
)

Definition at line 249 of file Listener.cpp.

References FindNextEventInternal(), and m_events_mutex.

◆ StartListeningForEvents() [1/2]

uint32_t Listener::StartListeningForEvents ( Broadcaster broadcaster,
uint32_t  event_mask 
)

◆ StartListeningForEvents() [2/2]

uint32_t Listener::StartListeningForEvents ( Broadcaster broadcaster,
uint32_t  event_mask,
HandleBroadcastCallback  callback,
void *  callback_user_data 
)

◆ StartListeningForEventSpec()

uint32_t Listener::StartListeningForEventSpec ( const lldb::BroadcasterManagerSP manager_sp,
const BroadcastEventSpec event_spec 
)

Definition at line 336 of file Listener.cpp.

References m_broadcaster_managers, and m_broadcasters_mutex.

◆ StopListeningForEvents()

bool Listener::StopListeningForEvents ( Broadcaster broadcaster,
uint32_t  event_mask 
)

◆ StopListeningForEventSpec()

bool Listener::StopListeningForEventSpec ( const lldb::BroadcasterManagerSP manager_sp,
const BroadcastEventSpec event_spec 
)

Definition at line 363 of file Listener.cpp.

References m_broadcasters_mutex.

Friends And Related Function Documentation

◆ Broadcaster

friend class Broadcaster
friend

Definition at line 39 of file Listener.h.

◆ BroadcasterManager

friend class BroadcasterManager
friend

Definition at line 40 of file Listener.h.

Member Data Documentation

◆ m_broadcaster_managers

broadcaster_manager_collection lldb_private::Listener::m_broadcaster_managers
private

Definition at line 132 of file Listener.h.

Referenced by BroadcasterManagerWillDestruct(), Clear(), and StartListeningForEventSpec().

◆ m_broadcasters

broadcaster_collection lldb_private::Listener::m_broadcasters
private

◆ m_broadcasters_mutex

std::mutex lldb_private::Listener::m_broadcasters_mutex
private

◆ m_events

event_collection lldb_private::Listener::m_events
private

Definition at line 129 of file Listener.h.

Referenced by AddEvent(), BroadcasterWillDestruct(), Clear(), and FindNextEventInternal().

◆ m_events_condition

std::condition_variable lldb_private::Listener::m_events_condition
private

Definition at line 131 of file Listener.h.

Referenced by AddEvent(), and GetEventInternal().

◆ m_events_mutex

std::mutex lldb_private::Listener::m_events_mutex
private

◆ m_name

std::string lldb_private::Listener::m_name
private

The documentation for this class was generated from the following files: