Project
Loading...
Searching...
No Matches
ErrorMap.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
12#ifndef O2_MCH_BASE_ERROR_MAP_H_H
13#define O2_MCH_BASE_ERROR_MAP_H_H
14
15#include <cstdint>
16#include <functional>
17#include <map>
18
19#include <gsl/span>
20
21#include "MCHBase/Error.h"
22
23namespace o2::mch
24{
25
38{
39 public:
40 using ErrorFunction = std::function<void(Error error)>;
41
43 void add(ErrorType errorType, uint32_t id0, uint32_t id1, uint64_t n = 1);
45 void add(Error error);
47 void add(gsl::span<const Error> errors);
49 void add(const ErrorMap& errors);
50
52 void clear() { mErrors.clear(); }
53
55 uint64_t getNumberOfErrorTypes() const { return mErrors.size(); }
57 uint64_t getNumberOfErrors() const;
59 uint64_t getNumberOfErrors(ErrorType type) const;
61 uint64_t getNumberOfErrors(ErrorGroup group) const;
62
64 void forEach(ErrorFunction f) const;
69
70 private:
71 std::map<ErrorType, std::map<uint64_t, Error>> mErrors{};
72};
73
74} // namespace o2::mch
75
76#endif
definition of the MCH processing errors
A container class to summarize errors encountered during processing.
Definition ErrorMap.h:38
void forEach(ErrorFunction f) const
Definition ErrorMap.cxx:90
uint64_t getNumberOfErrors() const
Definition ErrorMap.cxx:63
void add(ErrorType errorType, uint32_t id0, uint32_t id1, uint64_t n=1)
Definition ErrorMap.cxx:33
uint64_t getNumberOfErrorTypes() const
Definition ErrorMap.h:55
std::function< void(Error error)> ErrorFunction
Definition ErrorMap.h:40
GLdouble n
Definition glcorearb.h:1982
GLdouble f
Definition glcorearb.h:310
GLint GLint GLsizei GLint GLenum GLenum type
Definition glcorearb.h:275
GLboolean GLuint group
Definition glcorearb.h:3991
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
ErrorGroup
Definition Error.h:31
ErrorType
Definition Error.h:54