PlayRho  2.0.0
An interactive physics engine & library.
playrho::FlagGuard< T > Class Template Reference

Flag guard type. More...

#include <playrho/FlagGuard.hpp>

Public Member Functions

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

Detailed Description

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

Flag guard type.

Constructor & Destructor Documentation

◆ FlagGuard()

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.

◆ ~FlagGuard()

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

Destructor.

Unsets the bits that were set on construction.


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