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]
Collaboration diagram for lldb_private::Listener:
Collaboration 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::EventSP > event_collection
 
typedef std::vector< lldb::BroadcasterManagerWP > broadcaster_manager_collection
 

Private Member Functions

bool FindNextEventInternal (std::unique_lock< std::mutex > &lock, Broadcaster *broadcaster, const ConstString *sources, uint32_t num_sources, uint32_t event_type_mask, lldb::EventSP &event_sp, bool remove)
 
bool GetEventInternal (const Timeout< std::micro > &timeout, Broadcaster *broadcaster, const ConstString *sources, uint32_t num_sources, 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::recursive_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 36 of file Listener.h.

Member Typedef Documentation

◆ broadcaster_collection

Definition at line 112 of file Listener.h.

◆ broadcaster_manager_collection

typedef std::vector<lldb::BroadcasterManagerWP> lldb_private::Listener::broadcaster_manager_collection
private

Definition at line 115 of file Listener.h.

◆ event_collection

typedef std::list<lldb::EventSP> lldb_private::Listener::event_collection
private

Definition at line 113 of file Listener.h.

◆ HandleBroadcastCallback

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

Definition at line 38 of file Listener.h.

Constructor & Destructor Documentation

◆ Listener() [1/2]

Listener::Listener ( const char *  name)
protected

Definition at line 40 of file Listener.cpp.

References lldb_private::GetLogIfAllCategoriesSet(), LIBLLDB_LOG_OBJECT, LLDB_LOGF, and m_name.

Referenced by MakeListener().

◆ ~Listener()

Listener::~Listener ( )

◆ 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 188 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,
const ConstString sources,
uint32_t  num_sources,
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 398 of file Listener.cpp.

References GetEventInternal().

◆ GetEventForBroadcaster()

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

Definition at line 392 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 385 of file Listener.cpp.

References GetEventInternal().

◆ GetEventInternal()

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

◆ GetName()

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

Definition at line 59 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 318 of file Listener.cpp.

References FindNextEventInternal(), and m_events_mutex.

◆ PeekAtNextEventForBroadcaster()

Event * Listener::PeekAtNextEventForBroadcaster ( Broadcaster broadcaster)

Definition at line 326 of file Listener.cpp.

References FindNextEventInternal(), and m_events_mutex.

◆ PeekAtNextEventForBroadcasterWithType()

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

Definition at line 335 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 426 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 454 of file Listener.cpp.

References m_broadcasters_mutex.

Friends And Related Function Documentation

◆ Broadcaster

friend class Broadcaster
friend

Definition at line 40 of file Listener.h.

◆ BroadcasterManager

friend class BroadcasterManager
friend

Definition at line 41 of file Listener.h.

Member Data Documentation

◆ m_broadcaster_managers

broadcaster_manager_collection lldb_private::Listener::m_broadcaster_managers
private

Definition at line 136 of file Listener.h.

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

◆ m_broadcasters

broadcaster_collection lldb_private::Listener::m_broadcasters
private

◆ m_broadcasters_mutex

std::recursive_mutex lldb_private::Listener::m_broadcasters_mutex
private

◆ m_events

event_collection lldb_private::Listener::m_events
private

Definition at line 133 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 135 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: