AusweisApp2
 Alle Klassen Namensbereiche Dateien Funktionen Variablen Typdefinitionen Aufzählungen Aufzählungswerte Propertys Freundbeziehungen Makrodefinitionen
ScopeGuard.h
gehe zur Dokumentation dieser Datei
1 
7 #pragma once
8 
9 #include <functional>
10 
11 class test_ScopeGuard;
12 
13 namespace governikus
14 {
15 
17 {
18  private:
19  friend class ::test_ScopeGuard;
20 
21  const std::function<void()> mFunction;
22  bool mEnabled;
23 
24  public:
25  ScopeGuard(const ScopeGuard& pCopy) = delete;
26  ScopeGuard(const ScopeGuard&& pCopy) = delete;
27  ScopeGuard& operator=(const ScopeGuard& pCopy) = delete;
28  ScopeGuard& operator=(const ScopeGuard&& pCopy) = delete;
29 
30  ScopeGuard(const std::function<void()>& pFunc, bool pEnabled = true);
31  ~ScopeGuard();
32 
33  bool isEnabled() const;
34  void setEnabled(bool pEnabled = true);
35 };
36 
37 } /* namespace governikus */
void setEnabled(bool pEnabled=true)
Definition: ScopeGuard.cpp:37
~ScopeGuard()
Definition: ScopeGuard.cpp:22
ScopeGuard & operator=(const ScopeGuard &pCopy)=delete
bool isEnabled() const
Definition: ScopeGuard.cpp:31
Definition: ScopeGuard.h:16
ScopeGuard(const ScopeGuard &pCopy)=delete