libtcspc C++ API
Streaming TCSPC and time tag data processing
Loading...
Searching...
No Matches
errors.hpp
1/*
2 * This file is part of libtcspc
3 * Copyright 2019-2026 Board of Regents of the University of Wisconsin System
4 * SPDX-License-Identifier: MIT
5 */
6
7#pragma once
8
9#include <exception>
10#include <stdexcept>
11#include <string>
12#include <utility>
13
14namespace tcspc {
15
29class end_of_processing final : public std::exception {
30 std::string msg;
31
32 public:
39 explicit end_of_processing(std::string message)
40 : msg(std::move(message)) {}
41
43 [[nodiscard]] auto what() const noexcept -> char const * override {
44 return msg.c_str();
45 }
46};
47
56class source_halted final : public std::exception {
57 public:
59 [[nodiscard]] auto what() const noexcept -> char const * override {
60 return "source halted without flushing";
61 }
62};
63
71class acquisition_halted final : public std::exception {
72 public:
74 [[nodiscard]] auto what() const noexcept -> char const * override {
75 return "acquisition halted";
76 }
77};
78
84class buffer_overflow_error : public std::runtime_error {
85 public:
86 using std::runtime_error::runtime_error;
87};
88
95class data_validation_error : public std::runtime_error {
96 public:
97 using std::runtime_error::runtime_error;
98};
99
112class histogram_overflow_error : public std::runtime_error {
113 public:
114 using std::runtime_error::runtime_error;
115};
116
131class input_output_error : public std::runtime_error {
132 public:
133 using std::runtime_error::runtime_error;
134};
135
144 public:
145 using data_validation_error::data_validation_error;
146};
147
155class test_error : public std::runtime_error {
156 public:
157 using std::runtime_error::runtime_error;
158};
159
160} // namespace tcspc
Exception thrown when acquisition was halted.
Definition errors.hpp:71
auto what() const noexcept -> char const *override
Implements std::exception interface.
Definition errors.hpp:74
Error thrown when buffer capacity has been exhausted.
Definition errors.hpp:84
Error thrown when the data being processed does not meet expectations.
Definition errors.hpp:95
auto what() const noexcept -> char const *override
Implements std::exception interface.
Definition errors.hpp:43
end_of_processing(std::string message)
Construct with status message.
Definition errors.hpp:39
Error thrown when a histogram bin overflows.
Definition errors.hpp:112
Error thrown when a file or stream could not be accessed.
Definition errors.hpp:131
Error thrown when a fit to a model did not meet the desired criteria.
Definition errors.hpp:143
Exception type thrown to pumping thread when buffer source was discontinued without reaching the poin...
Definition errors.hpp:56
auto what() const noexcept -> char const *override
Implements std::exception interface.
Definition errors.hpp:59
Error thrown when requested to do so for testing purposes.
Definition errors.hpp:155
libtcspc namespace.
Definition acquire.hpp:29