Processors that stop processing when a given event is received.
template<typename EventList, typename Exception = std::runtime_error, typename Downstream>
| auto tcspc::stop_with_error |
( |
std::string | message_prefix, |
|
|
Downstream | downstream ) |
Create a processor that ends the stream with an error when a given event type is received.
If the triggering event type provides operator<< to std::ostream, the formatted event is appended to the exception message after message_prefix; otherwise the message consists of message_prefix only.
- See also
- tcspc::stop()
- Template Parameters
-
| EventList | event types that should cause stream to end |
| Exception | exception type to use (must be constructible from std::string) |
| Downstream | downstream processor type |
- Parameters
-
| message_prefix | error message prefix |
| downstream | downstream processor |
- Returns
- processor
- Events handled
- Types in EventList: throw Exception
- Types not in EventList: pass through with no action
- Flush: pass through with no action