Jolt Physics
A multi core friendly Game Physics Engine
Loading...
Searching...
No Matches
ScopeExit< F > Class Template Reference

Class that calls a function when it goes out of scope. More...

#include <ScopeExit.h>

Inheritance diagram for ScopeExit< F >:
NonCopyable

Public Member Functions

JPH_INLINE ScopeExit (F &&inFunction)
 Constructor specifies the exit function.
 
JPH_INLINE ~ScopeExit ()
 Destructor calls the exit function.
 
JPH_INLINE void Invoke ()
 Call the exit function now instead of when going out of scope.
 
JPH_INLINE void Release ()
 No longer call the exit function when going out of scope.
 
- Public Member Functions inherited from NonCopyable
 NonCopyable ()=default
 
 NonCopyable (const NonCopyable &)=delete
 
void operator= (const NonCopyable &)=delete
 

Detailed Description

template<class F>
class ScopeExit< F >

Class that calls a function when it goes out of scope.

Constructor & Destructor Documentation

◆ ScopeExit()

template<class F >
JPH_INLINE ScopeExit< F >::ScopeExit ( F &&  inFunction)
inlineexplicit

Constructor specifies the exit function.

◆ ~ScopeExit()

template<class F >
JPH_INLINE ScopeExit< F >::~ScopeExit ( )
inline

Destructor calls the exit function.

Member Function Documentation

◆ Invoke()

template<class F >
JPH_INLINE void ScopeExit< F >::Invoke ( )
inline

Call the exit function now instead of when going out of scope.

◆ Release()

template<class F >
JPH_INLINE void ScopeExit< F >::Release ( )
inline

No longer call the exit function when going out of scope.


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