LLDB mainline
lldb_private::TargetGroupList Class Reference

A thread-safe collection of target groups. More...

#include <TargetGroupList.h>

Public Member Functions

 ~TargetGroupList ()
 TargetGroupList (const TargetGroupList &)=delete
TargetGroupList & operator= (const TargetGroupList &)=delete
 TargetGroupList (TargetGroupList &&)=delete
TargetGroupList & operator= (TargetGroupList &&)=delete
lldb::TargetGroupSP CreateTargetGroup (llvm::StringRef description)
bool DeleteTargetGroup (const lldb::TargetGroupSP &group_sp)
 Remove group_sp from this list.
std::vector< lldb::TargetGroupSP > GetGroups () const
 Return a snapshot of the target groups.

Private Member Functions

 TargetGroupList (Debugger &debugger)
 TargetGroupList (Debugger &debugger, const std::shared_ptr< std::recursive_mutex > &mutex)
void Add (const lldb::TargetGroupSP &group_sp)
void Remove (const TargetGroup *group)
void Clear ()
void RemoveTarget (const lldb::TargetSP &target_sp)

Private Attributes

Debugger & m_debugger
std::shared_ptr< std::recursive_mutex > m_mutex
 Shared by the debugger's list, each target's list, and every group.
std::vector< lldb::TargetGroupSP > m_groups

Friends

class Debugger
class Target
class TargetGroup

Detailed Description

A thread-safe collection of target groups.

A Debugger uses one as its registry, and each Target uses one for the groups it belongs to.

Definition at line 22 of file TargetGroupList.h.

Constructor & Destructor Documentation

◆ TargetGroupList() [1/4]

lldb_private::TargetGroupList::TargetGroupList ( Debugger & debugger)
inlineexplicitprivate

Definition at line 27 of file TargetGroupList.h.

References Debugger, m_debugger, and m_mutex.

Referenced by operator=(), operator=(), TargetGroupList(), and TargetGroupList().

◆ TargetGroupList() [2/4]

lldb_private::TargetGroupList::TargetGroupList ( Debugger & debugger,
const std::shared_ptr< std::recursive_mutex > & mutex )
inlineprivate

Definition at line 31 of file TargetGroupList.h.

References Debugger, m_debugger, and m_mutex.

◆ ~TargetGroupList()

TargetGroupList::~TargetGroupList ( )

Definition at line 16 of file TargetGroupList.cpp.

References Clear().

◆ TargetGroupList() [3/4]

lldb_private::TargetGroupList::TargetGroupList ( const TargetGroupList & )
delete

References TargetGroupList().

◆ TargetGroupList() [4/4]

lldb_private::TargetGroupList::TargetGroupList ( TargetGroupList && )
delete

References TargetGroupList().

Member Function Documentation

◆ Add()

void TargetGroupList::Add ( const lldb::TargetGroupSP & group_sp)
private

Definition at line 43 of file TargetGroupList.cpp.

References m_groups, and m_mutex.

◆ Clear()

void TargetGroupList::Clear ( )
private

Definition at line 70 of file TargetGroupList.cpp.

References m_groups, and m_mutex.

Referenced by ~TargetGroupList().

◆ CreateTargetGroup()

TargetGroupSP TargetGroupList::CreateTargetGroup ( llvm::StringRef description)

Definition at line 18 of file TargetGroupList.cpp.

References m_debugger, m_groups, m_mutex, and TargetGroup.

◆ DeleteTargetGroup()

bool TargetGroupList::DeleteTargetGroup ( const lldb::TargetGroupSP & group_sp)

Remove group_sp from this list.

Other shared references, including target membership lists, remain valid.

Definition at line 26 of file TargetGroupList.cpp.

References m_groups, and m_mutex.

◆ GetGroups()

std::vector< TargetGroupSP > TargetGroupList::GetGroups ( ) const

Return a snapshot of the target groups.

Modifying the returned vector does not modify this list.

Definition at line 38 of file TargetGroupList.cpp.

References m_groups, and m_mutex.

Referenced by CommandObjectTargetGroupsList::DoExecute().

◆ operator=() [1/2]

TargetGroupList & lldb_private::TargetGroupList::operator= ( const TargetGroupList & )
delete

References TargetGroupList().

◆ operator=() [2/2]

TargetGroupList & lldb_private::TargetGroupList::operator= ( TargetGroupList && )
delete

References TargetGroupList().

◆ Remove()

void TargetGroupList::Remove ( const TargetGroup * group)
private

Definition at line 52 of file TargetGroupList.cpp.

References m_groups, m_mutex, and TargetGroup.

◆ RemoveTarget()

void TargetGroupList::RemoveTarget ( const lldb::TargetSP & target_sp)
private

Definition at line 59 of file TargetGroupList.cpp.

References m_groups, and m_mutex.

◆ Debugger

friend class Debugger
friend

Definition at line 24 of file TargetGroupList.h.

References Debugger.

Referenced by Debugger, TargetGroupList(), and TargetGroupList().

◆ Target

friend class Target
friend

Definition at line 25 of file TargetGroupList.h.

References Target.

Referenced by Target.

◆ TargetGroup

friend class TargetGroup
friend

Definition at line 54 of file TargetGroupList.h.

References TargetGroup.

Referenced by CreateTargetGroup(), Remove(), and TargetGroup.

Member Data Documentation

◆ m_debugger

Debugger& lldb_private::TargetGroupList::m_debugger
private

Definition at line 61 of file TargetGroupList.h.

Referenced by CreateTargetGroup(), TargetGroupList(), and TargetGroupList().

◆ m_groups

std::vector<lldb::TargetGroupSP> lldb_private::TargetGroupList::m_groups
private

◆ m_mutex

std::shared_ptr<std::recursive_mutex> lldb_private::TargetGroupList::m_mutex
private

Shared by the debugger's list, each target's list, and every group.

Group membership operations never acquire Target::m_mutex.

Definition at line 64 of file TargetGroupList.h.

Referenced by Add(), Clear(), CreateTargetGroup(), DeleteTargetGroup(), GetGroups(), Remove(), RemoveTarget(), TargetGroupList(), and TargetGroupList().


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