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

A class used to group progress reports by category. More...

#include <Progress.h>

Classes

struct  Entry
 Entry used for bookkeeping. More...
 

Public Member Functions

 ProgressManager ()
 
 ~ProgressManager ()
 
void Increment (const Progress::ProgressData &)
 Control the refcount of the progress report category as needed.
 
void Decrement (const Progress::ProgressData &)
 

Static Public Member Functions

static void Initialize ()
 
static void Terminate ()
 
static bool Enabled ()
 
static ProgressManagerInstance ()
 

Protected Types

enum class  EventType { Begin , End }
 

Protected Member Functions

void Expire (llvm::StringRef key)
 Helper function for reporting progress when the alarm in the corresponding entry in the map expires.
 

Static Protected Member Functions

static void ReportProgress (const Progress::ProgressData &progress_data, EventType type)
 
static std::optional< ProgressManager > & InstanceImpl ()
 

Protected Attributes

llvm::StringMap< Entrym_entries
 Map used for bookkeeping.
 
std::mutex m_entries_mutex
 Mutex to provide the map.
 
Alarm m_alarm
 Alarm instance to coalesce progress events.
 

Detailed Description

A class used to group progress reports by category.

This is done by using a map that maintains a refcount of each category of progress reports that have come in. Keeping track of progress reports this way will be done if a debugger is listening to the eBroadcastBitProgressByCategory broadcast bit.

Definition at line 145 of file Progress.h.

Member Enumeration Documentation

◆ EventType

enum class lldb_private::ProgressManager::EventType
strongprotected
Enumerator
Begin 
End 

Definition at line 160 of file Progress.h.

Constructor & Destructor Documentation

◆ ProgressManager()

ProgressManager::ProgressManager ( )

Definition at line 84 of file Progress.cpp.

◆ ~ProgressManager()

ProgressManager::~ProgressManager ( )

Definition at line 87 of file Progress.cpp.

Member Function Documentation

◆ Decrement()

void ProgressManager::Decrement ( const Progress::ProgressData progress_data)

◆ Enabled()

bool ProgressManager::Enabled ( )
static

Definition at line 99 of file Progress.cpp.

References InstanceImpl().

Referenced by lldb_private::Progress::Progress(), and lldb_private::Progress::~Progress().

◆ Expire()

void ProgressManager::Expire ( llvm::StringRef  key)
protected

Helper function for reporting progress when the alarm in the corresponding entry in the map expires.

Definition at line 178 of file Progress.cpp.

References End, m_entries, m_entries_mutex, and ReportProgress().

Referenced by Decrement().

◆ Increment()

void ProgressManager::Increment ( const Progress::ProgressData progress_data)

◆ Initialize()

void ProgressManager::Initialize ( )
static

Definition at line 89 of file Progress.cpp.

References InstanceImpl().

Referenced by lldb_private::SystemInitializerFull::Initialize().

◆ Instance()

ProgressManager & ProgressManager::Instance ( )
static

Definition at line 101 of file Progress.cpp.

References InstanceImpl().

Referenced by lldb_private::Progress::Progress(), and lldb_private::Progress::~Progress().

◆ InstanceImpl()

std::optional< ProgressManager > & ProgressManager::InstanceImpl ( )
staticprotected

Definition at line 106 of file Progress.cpp.

Referenced by Enabled(), Initialize(), Instance(), and Terminate().

◆ ReportProgress()

void ProgressManager::ReportProgress ( const Progress::ProgressData progress_data,
EventType  type 
)
staticprotected

◆ Terminate()

void ProgressManager::Terminate ( )
static

Definition at line 94 of file Progress.cpp.

References InstanceImpl().

Referenced by lldb_private::SystemInitializerFull::Terminate().

Member Data Documentation

◆ m_alarm

Alarm lldb_private::ProgressManager::m_alarm
protected

Alarm instance to coalesce progress events.

Definition at line 192 of file Progress.h.

Referenced by Decrement(), and Increment().

◆ m_entries

llvm::StringMap<Entry> lldb_private::ProgressManager::m_entries
protected

Map used for bookkeeping.

Definition at line 186 of file Progress.h.

Referenced by Decrement(), Expire(), and Increment().

◆ m_entries_mutex

std::mutex lldb_private::ProgressManager::m_entries_mutex
protected

Mutex to provide the map.

Definition at line 189 of file Progress.h.

Referenced by Decrement(), Expire(), and Increment().


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