errReport.hpp
Go to the documentation of this file.
1
2#pragma once
3
4#include "core/common.hpp"
5#include "core/type/ntype.hpp"
7
8namespace by {
9
14 class _nout errReport: public instance, public dumpable {
15 BY(CLASS(errReport, instance))
16
17 public:
18 errReport();
19 errReport(nbool isNoisy);
20
21 public:
22 nbool operator==(const me& rhs) const;
23 nbool operator!=(const me& rhs) const;
24 const baseErr& operator[](nidx n) const;
25 operator nbool() const;
26
27 public:
28 nbool inErr() const;
29 nbool inErr(nidx since) const;
30 nbool inWarn() const;
31 nbool inWarn(nidx since) const;
32 nbool in(errLv::level type) const;
33 nbool in(errLv::level type, nidx since) const;
34
35 const baseErr* get(nidx n) const;
36
37 ncnt len() const;
38
39 virtual const baseErr& add(const baseErr& new1);
40 const baseErr* add(const baseErr* it) BY_SIDE_FUNC(it, &add(*it), nullptr);
41 void add(const me& rhs);
42
43 std::vector<tstr<baseErr>>::const_iterator begin() const;
44 std::vector<tstr<baseErr>>::const_iterator last() const;
45 std::vector<tstr<baseErr>>::const_iterator end() const;
46
47 void log(nidx since) const;
48 void log() const;
49 virtual void dump(nidx since) const;
50 void dump() const override;
51
52 void rel();
53
54 nbool isNoisy() const;
55 me& setNoisy(nbool isNoisy);
56
57 private:
58 void _noise(const baseErr& new1);
59
60 private:
61 std::vector<tstr<baseErr>> _errs;
62
65 nbool _isNoisy;
66 };
67
71 class _nout dummyErrReport: public errReport {
72 BY(CLASS(dummyErrReport, errReport))
73
74 public:
75 const baseErr& add(const baseErr& new1) override;
76
77 static me singleton;
78 };
79} // namespace by
Base class for all error types.
Definition: baseErr.hpp:12
Dummy error reporter that discards all errors.
Definition: errReport.hpp:71
Interface for objects that can dump their state.
Definition: dumpable.hpp:12
Deferred execution utility like defer keyword in other languages.
Definition: end.hpp:14
Error reporting and collection system.
Definition: errReport.hpp:14
void dump() const override
Dump object state for debugging.
Base class for all managed instances in memlite system.
Definition: instance.hpp:20
Base class for runtime type information in byeol language.
Definition: type.hpp:12