ATLAS Offline Software
Loading...
Searching...
No Matches
WithRootErrorHandler.h
Go to the documentation of this file.
1// This file's extension implies that it's C, but it's really -*- C++ -*-.
2/*
3 * Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration.
4 */
11
12
13#include "TError.h"
14#include <functional>
15#include <type_traits>
16
17
18#ifndef ROOTUTILS_WITHROOTERRORHANDLER_H
19#define ROOTUTILS_WITHROOTERRORHANDLER_H
20
21namespace RootUtils {
22
23
56{
57public:
58 // A ROOT error handler has signature
59 // void hand (int level, Bool_t abort, const char* location, const char* msg)
60
63 using Handler_t = std::function<bool (int, Bool_t, const char*, const char*)>;
64
65
77
78
85
86
87 // Try to prevent misuse.
92
93 static void* operator new (size_t) = delete;
94 static void* operator new[] (size_t) = delete;
95 static void operator delete (void*) = delete;
96 static void operator delete[] (void*) = delete;
97
98
99private:
101 size_t m_size;
102};
103
104
105} // namespace RootUtils
106
107#endif // not ROOTUTILS_WITHROOTERRORHANDLER_H
WithRootErrorHandler & operator=(const WithRootErrorHandler &)=delete
WithRootErrorHandler(const WithRootErrorHandler &)=delete
std::function< bool(int, Bool_t, const char *, const char *)> Handler_t
Type of handler to register.
WithRootErrorHandler(Handler_t errhand)
Temporarily install a thread-local root error handler.
WithRootErrorHandler(WithRootErrorHandler &&)=delete