perfc 0.11.0
Loading...
Searching...
No Matches
perfc::ScopedRegistration Class Reference

RAII object to manage automatic deregistration. More...

#include <register.hpp>

Detailed Description

RAII object to manage automatic deregistration.

Thread Safety
thread-compatible

Definition at line 149 of file register.hpp.

Public Member Functions

 ScopedRegistration () noexcept=default
 
 ScopedRegistration (ScopedRegistration &&) noexcept=default
 
ScopedRegistrationoperator= (ScopedRegistration &&) noexcept=default
 
 ~ScopedRegistration () noexcept
 
Observers
bool IsValid () const noexcept
 
 operator bool () const noexcept
 
Modifiers
void Release () noexcept
 Release ownership such that destroying object will not deregister counter.
 
void Reset () noexcept
 Deregisters counter if object is managing a registration.
 
void Swap (ScopedRegistration &other) noexcept
 Swaps two entries.
 

Protected Member Functions

 ScopedRegistration (std::function< void()> dereg)
 

Friends

template<class CounterType, class MetadataType, class Mutex>
class Register
 

Constructor & Destructor Documentation

◆ ScopedRegistration() [1/3]

perfc::ScopedRegistration::ScopedRegistration ( )
defaultnoexcept

◆ ScopedRegistration() [2/3]

perfc::ScopedRegistration::ScopedRegistration ( ScopedRegistration && )
defaultnoexcept

◆ ~ScopedRegistration()

perfc::ScopedRegistration::~ScopedRegistration ( )
inlinenoexcept

Definition at line 154 of file register.hpp.

◆ ScopedRegistration() [3/3]

perfc::ScopedRegistration::ScopedRegistration ( std::function< void()> dereg)
inlineprotected

Definition at line 211 of file register.hpp.

Member Function Documentation

◆ IsValid()

bool perfc::ScopedRegistration::IsValid ( ) const
inlinenoexcept
Returns
true if it still manages a deregistration.

Definition at line 164 of file register.hpp.

◆ operator bool()

perfc::ScopedRegistration::operator bool ( ) const
inlinenoexcept
Returns
true if it still manages a deregistration.

Definition at line 170 of file register.hpp.

◆ operator=()

ScopedRegistration & perfc::ScopedRegistration::operator= ( ScopedRegistration && )
defaultnoexcept

◆ Release()

void perfc::ScopedRegistration::Release ( )
inlinenoexcept

Release ownership such that destroying object will not deregister counter.

Postcondition
IsValid() == false

Definition at line 183 of file register.hpp.

◆ Reset()

void perfc::ScopedRegistration::Reset ( )
inlinenoexcept

Deregisters counter if object is managing a registration.

Postcondition
IsValid() == false

Definition at line 192 of file register.hpp.

◆ Swap()

void perfc::ScopedRegistration::Swap ( ScopedRegistration & other)
noexcept

Swaps two entries.

Parameters
otherExchanges ownership between *this and other.

Friends And Related Symbol Documentation

◆ Register

template<class CounterType, class MetadataType, class Mutex>
friend class Register
friend
Note
From C++20 std::function(function&&) is noexcept

Definition at line 210 of file register.hpp.


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