MySQL 8.3.0
Source Code Documentation
resource_blocker::User Class Reference

#include <resource_blocker.h>

Public Member Functions

 User ()
 By default, does not use any Resource. More...
 
 User (Resource &resource)
 Attempt to start using the given Resource. More...
 
 User (User &other)
 Use the same Resource that other uses, if any. More...
 
 User (User &&other) noexcept
 Take over the Resource that other uses, if any. More...
 
Useroperator= (User const &other)
 Release our own Resource, if any, and then start using the Resource that other uses, if any. More...
 
Useroperator= (User &&other) noexcept
 Release our own resource, if any, and then steal the Resource that other uses, if any, so that other will not use it any more. More...
 
 operator bool ()
 Return true if we hold the Resource in 'used' state. More...
 
bool operator! ()
 Return false if we hold the Resource in 'used' state. More...
 
Resource::String_set block_reasons ()
 Return the set of strings that explain the reasons why the resource was blocked. More...
 
void end_use ()
 Stop holding the Resource in 'used' state, if we do. More...
 
 ~User ()
 Stop holding the Resource in 'used' state, if we do. More...
 

Private Attributes

Resourcem_resource {nullptr}
 
Resource::String_set m_block_reasons
 

Constructor & Destructor Documentation

◆ User() [1/4]

resource_blocker::User::User ( )
inline

By default, does not use any Resource.

◆ User() [2/4]

resource_blocker::User::User ( Resource resource)
inlineexplicit

Attempt to start using the given Resource.

This may fail, so the caller must check if it succeeded or not, using operator bool or operator!.

◆ User() [3/4]

resource_blocker::User::User ( User other)
inline

Use the same Resource that other uses, if any.

◆ User() [4/4]

resource_blocker::User::User ( User &&  other)
inlinenoexcept

Take over the Resource that other uses, if any.

◆ ~User()

resource_blocker::User::~User ( )
inline

Stop holding the Resource in 'used' state, if we do.

Member Function Documentation

◆ block_reasons()

Resource::String_set resource_blocker::User::block_reasons ( )
inline

Return the set of strings that explain the reasons why the resource was blocked.

◆ end_use()

void resource_blocker::User::end_use ( )
inline

Stop holding the Resource in 'used' state, if we do.

◆ operator bool()

resource_blocker::User::operator bool ( )
inlineexplicit

Return true if we hold the Resource in 'used' state.

◆ operator!()

bool resource_blocker::User::operator! ( )
inline

Return false if we hold the Resource in 'used' state.

◆ operator=() [1/2]

User & resource_blocker::User::operator= ( User &&  other)
inlinenoexcept

Release our own resource, if any, and then steal the Resource that other uses, if any, so that other will not use it any more.

◆ operator=() [2/2]

User & resource_blocker::User::operator= ( User const &  other)
inline

Release our own Resource, if any, and then start using the Resource that other uses, if any.

Member Data Documentation

◆ m_block_reasons

Resource::String_set resource_blocker::User::m_block_reasons
private

◆ m_resource

Resource* resource_blocker::User::m_resource {nullptr}
private

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