CppCommon 1.0.5.0
C++ Common Library
Loading...
Searching...
No Matches
stack_trace_manager.h
Go to the documentation of this file.
1
9#ifndef CPPCOMMON_SYSTEM_STACK_TRACE_MANAGER_H
10#define CPPCOMMON_SYSTEM_STACK_TRACE_MANAGER_H
11
12#include "errors/exceptions.h"
13#include "utility/singleton.h"
14
15#include <memory>
16
17namespace CppCommon {
18
20
25class StackTraceManager : public CppCommon::Singleton<StackTraceManager>
26{
28
29public:
33
36
38
42 static void Initialize();
44
47 static void Cleanup();
48
49private:
50 class Impl;
51
52 Impl& impl() noexcept { return reinterpret_cast<Impl&>(_storage); }
53 const Impl& impl() const noexcept { return reinterpret_cast<Impl const&>(_storage); }
54
55 static const size_t StorageSize = 4;
56 static const size_t StorageAlign = 1;
57 alignas(StorageAlign) std::byte _storage[StorageSize];
58
59 StackTraceManager();
60};
61
62} // namespace CppCommon
63
64#endif // CPPCOMMON_SYSTEM_STACK_TRACE_MANAGER_H
Singleton template base class.
Definition singleton.h:47
StackTraceManager(StackTraceManager &&)=delete
StackTraceManager & operator=(StackTraceManager &&)=delete
StackTraceManager & operator=(const StackTraceManager &)=delete
StackTraceManager(const StackTraceManager &)=delete
static void Initialize()
Initialize stack trace manager.
static void Cleanup()
Cleanup stack trace manager.
Exceptions definition.
C++ Common project definitions.
Singleton definition.