PlayRho  1.1.0
An Interactive Real-Time-Oriented C++ Physics Engine & Library
playrho::FlagGuard< T > Class Template Reference

Flag guard type. More...

#include <FlagGuard.hpp>

Collaboration diagram for playrho::FlagGuard< T >:
[legend]

Public Member Functions

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

Private Attributes

T & m_flag
 Flag.
 
m_value
 Value.
 

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: