playrho::FlagGuard< T > Class Template Reference

Flag guard type. More...

#include <FlagGuard.hpp>

Public Member Functions

 FlagGuard (T &flag, T value)
 Initializing constructor. More...
 
 FlagGuard (const FlagGuard< T > &value)=default
 Copy constructor. More...
 
 FlagGuard (FlagGuard< T > &&value) noexcept=default
 Move constructor. More...
 
FlagGuard< T > & operator= (const FlagGuard< T > &value)=default
 Copy assignment operator. More...
 
FlagGuard< T > & operator= (FlagGuard< T > &&value) noexcept=default
 Move assignment operator. More...
 
 ~FlagGuard () noexcept
 Destructor. More...
 
 FlagGuard ()=delete
 

Detailed Description

template<typename T>
class playrho::FlagGuard< T >

Flag guard type.

Definition at line 30 of file FlagGuard.hpp.

Constructor & Destructor Documentation

◆ FlagGuard() [1/4]

template<typename T >
playrho::FlagGuard< T >::FlagGuard ( T &  flag,
value 
)
inline

Initializing constructor.

Sets the given flag variable to the bitwise or of it with the given value and then unsets those bits on destruction of this instance.

Parameters
flagFlag variable to set until the destruction of this instance.
valueBit value to or with the flag variable on construction.

Definition at line 38 of file FlagGuard.hpp.

◆ FlagGuard() [2/4]

template<typename T >
playrho::FlagGuard< T >::FlagGuard ( const FlagGuard< T > &  value)
default

Copy constructor.

◆ FlagGuard() [3/4]

template<typename T >
playrho::FlagGuard< T >::FlagGuard ( FlagGuard< T > &&  value)
defaultnoexcept

Move constructor.

◆ ~FlagGuard()

template<typename T >
playrho::FlagGuard< T >::~FlagGuard ( )
inlinenoexcept

Destructor.

Unsets the bits that were set on construction.

Definition at line 58 of file FlagGuard.hpp.

◆ FlagGuard() [4/4]

template<typename T >
playrho::FlagGuard< T >::FlagGuard ( )
delete

Member Function Documentation

◆ operator=() [1/2]

template<typename T >
FlagGuard<T>& playrho::FlagGuard< T >::operator= ( const FlagGuard< T > &  value)
default

Copy assignment operator.

◆ operator=() [2/2]

template<typename T >
FlagGuard<T>& playrho::FlagGuard< T >::operator= ( FlagGuard< T > &&  value)
defaultnoexcept

Move assignment operator.


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