LibrePCB Developers Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ScopeGuard< Fun > Class Template Referencefinal

#include <scopeguard.h>

+ Inheritance diagram for ScopeGuard< Fun >:
+ Collaboration diagram for ScopeGuard< Fun >:

Public Member Functions

 ScopeGuard ()=delete
 
 ScopeGuard (const ScopeGuard &)=delete
 
 ScopeGuard (Fun f) noexcept
 
 ScopeGuard (ScopeGuard &&rhs) noexcept
 
 ~ScopeGuard () noexcept
 
ScopeGuardoperator= (const ScopeGuard &)=delete
 
- Public Member Functions inherited from ScopeGuardBase
 ScopeGuardBase () noexcept
 
 ScopeGuardBase (ScopeGuardBase &&rhs) noexcept
 
void dismiss () noexcept
 

Private Attributes

Fun mF
 

Additional Inherited Members

- Protected Member Functions inherited from ScopeGuardBase
 ~ScopeGuardBase ()=default
 
- Protected Attributes inherited from ScopeGuardBase
bool mActive
 

Detailed Description

template<class Fun>
class librepcb::ScopeGuard< Fun >

Implementation of a ScopeGuard based on https://channel9.msdn.com/Shows/Going+Deep/C-and-Beyond-2012-Andrei-Alexandrescu-Systematic-Error-Handling-in-C

Constructor & Destructor Documentation

ScopeGuard ( )
delete
ScopeGuard ( const ScopeGuard< Fun > &  )
delete
ScopeGuard ( Fun  f)
inlinenoexcept
ScopeGuard ( ScopeGuard< Fun > &&  rhs)
inlinenoexcept
~ScopeGuard ( )
inlinenoexcept

Calls the attached cleanup function

Member Function Documentation

ScopeGuard& operator= ( const ScopeGuard< Fun > &  )
delete

Member Data Documentation

Fun mF
private

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