|
libtcspc C++ API
Streaming TCSPC and time tag data processing
|
Processors for unit testing of processors.
Functions | |
| template<typename EventList> | |
| auto | tcspc::capture_output (access_tracker< capture_output_access > &&tracker) |
| Create a sink that records the output of a processor under test. | |
| template<typename Downstream> | |
| auto | tcspc::feed_input (feed_as value_category, Downstream downstream) |
| Create a source for feeding test input to a processor under test. | |
| template<typename EventList> | |
| auto | tcspc::sink_event_list () |
| Create a processor that ignores only specific event types. | |
| template<typename... Event> | |
| auto | tcspc::sink_events () |
| Create a processor that ignores only specific event types. | |
| auto tcspc::capture_output | ( | access_tracker< capture_output_access > && | tracker | ) |
Create a sink that records the output of a processor under test.
In order to access the recorded output or arrange to simulate errors and end-of-processing, use a tcspc::capture_output_access (usually accessed through the wrapper tcspc::capture_output_checker) retrieved from the tcspc::context from which tracker was obtained.
| EventList | event set to accept |
| tracker | access tracker for later access to state |
| auto tcspc::feed_input | ( | feed_as | value_category, |
| Downstream | downstream ) |
Create a source for feeding test input to a processor under test.
In addition to handle(), flush(), and introspection, the processor has this member function:
At least one output must be registered with this function before feeding input events (via handle()), or else std::logic_error is thrown.
Events are fed according to value_category, making a copy if necessary (when the event is an lvalue and tcspc::feed_as::rvalue is requested). Thus, the value category of the event passed to handle() does not affect how it is fed to the processor under test.
| Downstream | downstream processor type (usually deduced) |
| value_category | value category (kind of reference) used to feed event |
| downstream | downstream processor (processor under test) |
| auto tcspc::sink_event_list | ( | ) |
Create a processor that ignores only specific event types.
This can be used for compile-time checks of the output event types of a processor.
| EventList | event types to accept |
| auto tcspc::sink_events | ( | ) |
Create a processor that ignores only specific event types.
This can be used for compile-time checks of the output event types of a processor.
| Event | event types to accept |