libtcspc C++ API
Streaming TCSPC and time tag data processing
Loading...
Searching...
No Matches
tcspc::buffer_access Class Reference

Description

Access for tcspc::buffer() and tcspc::real_time_buffer() processors.

Public Member Functions

void halt () noexcept
 Halt pumping of the buffer.
void pump ()
 Pump buffered events downstream.

Member Function Documentation

◆ halt()

void tcspc::buffer_access::halt ( )
inlinenoexcept

Halt pumping of the buffer.

The call to pump() will return (if it hasn't yet) without flushing the downstream.

This function must be called when:

  • Processing is being canceled at the source before flushing the processors upstream of the buffer.
  • An error (an exception other than tcspc::end_of_processing) was received at the source while sending an event to, or flushing, the processors upstream of the buffer.

These are two cases in which the buffer would otherwise have no knowledge that the processing ended.

It is also safe to call this function after tcspc::end_of_processing was received at the source, or after the source successfully flushed the processors upstream of the buffer. In these cases, the call has no effect.

◆ pump()

void tcspc::buffer_access::pump ( )
inline

Pump buffered events downstream.

This function should be called on a thread other than the one on which upstream events are sent to the buffer. Events will be emitted to the buffer's downstream on the calling thread.

Depending on how the processing ends, this function exits in different ways:

  • If a flush is propagated from upstream of the buffer to its downstream, this function returns.
  • If an exception (either tcspc::end_of_processing or an error) is thrown downstream of the buffer, this function throws that exception.
  • If halt() is called before the buffer receives a flush from its upstream, this function throws tcspc::source_halted.

Applications should generally report errors for exceptions other than tcspc::end_of_processing and tcspc::source_halted. Note that such exceptions are not propagated to upstream processors (because there may not be the opportunity to do so if the upstream never calls the buffer again).


The documentation for this class was generated from the following file: