libtcspc C++ API
Streaming TCSPC and time tag data processing
Loading...
Searching...
No Matches
Buckets and bucket sources

Description

Handling of large data buffers.

Buckets (tcspc::bucket instances) are used where a single event carries a large quantity of data, such that it is beneficial to avoid copying the data, including to its ultimate destination. Correct use of buckets enables zero-copy writing of processing results to externally-provided destination memory.

Bucket sources provide bucket instances using different backing storage and management thereof.

Topics

 Bucket sources
 Objects producing a series of tcspc::bucket instances to carry data.

Classes

class  tcspc::bucket< T >
 Value-semantic container for array data allowing use of custom storage. More...

Functions

template<typename T>
auto tcspc::ad_hoc_bucket (std::span< T > s) -> bucket< T >
 Create a tcspc::bucket referencing a span.

Function Documentation

◆ ad_hoc_bucket()

template<typename T>
auto tcspc::ad_hoc_bucket ( std::span< T > s) -> bucket< T >
nodiscard

Create a tcspc::bucket referencing a span.

This can be used when a bucket is needed but is only used to view existing data and its storage is not important. The storage of the returned bucket cannot be observed or extracted.

Attention
The caller is responsible for ensuring that the data in the span outlives the returned bucket. Usually this means that the returned bucket should only be published (e.g., by emitting to downstream) via const reference and should never be returned or stored by the caller.
Template Parameters
Tthe bucket data element type
Parameters
sthe span to wrap as an ad-hoc bucket