LLDB mainline
lldb_private::PolicyStack::Guard Class Reference

RAII guard that pops a policy on destruction. More...

#include <Policy.h>

Public Member Functions

 ~Guard ()
 Guard (Guard &&other)
Guardoperator= (Guard &&other)
 Guard (const Guard &)=delete
Guardoperator= (const Guard &)=delete

Private Member Functions

 Guard ()

Private Attributes

std::thread::id m_thread_id
bool m_active = false

Friends

class PolicyStack

Detailed Description

RAII guard that pops a policy on destruction.

A Guard is bound to the thread that created it: the policy stack lives in thread_local storage, so popping from a different thread would corrupt that thread's stack. Guards may be moved, but only on the owning thread; a cross-thread move or destruction is a fatal error.

Definition at line 113 of file Policy.h.

Constructor & Destructor Documentation

◆ ~Guard()

PolicyStack::Guard::~Guard ( )

◆ Guard() [1/3]

PolicyStack::Guard::Guard ( Guard && other)

Definition at line 64 of file Policy.cpp.

References Guard(), m_active, and m_thread_id.

Referenced by Guard(), Guard(), operator=(), operator=(), and PolicyStack.

◆ Guard() [2/3]

lldb_private::PolicyStack::Guard::Guard ( const Guard & )
delete

References Guard().

◆ Guard() [3/3]

lldb_private::PolicyStack::Guard::Guard ( )
inlineprivate

Definition at line 125 of file Policy.h.

References m_active, and m_thread_id.

Member Function Documentation

◆ operator=() [1/2]

Guard & lldb_private::PolicyStack::Guard::operator= ( const Guard & )
delete

References Guard().

◆ operator=() [2/2]

PolicyStack::Guard & PolicyStack::Guard::operator= ( Guard && other)

◆ PolicyStack

friend class PolicyStack
friend

Definition at line 114 of file Policy.h.

References Guard(), and PolicyStack.

Referenced by PolicyStack.

Member Data Documentation

◆ m_active

bool lldb_private::PolicyStack::Guard::m_active = false
private

Definition at line 127 of file Policy.h.

Referenced by Guard(), Guard(), operator=(), and ~Guard().

◆ m_thread_id

std::thread::id lldb_private::PolicyStack::Guard::m_thread_id
private

Definition at line 126 of file Policy.h.

Referenced by Guard(), Guard(), operator=(), and ~Guard().


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