libtcspc C++ API
Streaming TCSPC and time tag data processing
Loading...
Searching...
No Matches
tcspc::sharable_recycling_bucket_source< T, Blocking, ClearRecycled > Class Template Referencefinal

Description

template<typename T, bool Blocking = false, bool ClearRecycled = false>
class tcspc::sharable_recycling_bucket_source< T, Blocking, ClearRecycled >

Sharable bucket source that reuses storage.

This bucket source behaves identically to tcspc::recycling_bucket_source, except that creation of shared view buckets is supported.

Bucket storage is reused after all shared views are destroyed.

Inherits tcspc::bucket_source< T >, and std::enable_shared_from_this< sharable_recycling_bucket_source< T, false, false > >.

Public Member Functions

auto bucket_of_size (std::size_t size) -> bucket< T > override
 Implements bucket source requirement.
auto shared_view_of (bucket< T > const &bkt) -> bucket< T const > override
 Implements sharable bucket source requirement.
auto supports_shared_views () const noexcept -> bool override
 Implements sharable bucket source requirement.

Static Public Member Functions

static auto create (arg::max_bucket_count<> max_bucket_count=arg::max_bucket_count{std::numeric_limits< std::size_t >::max()}, arg::max_recycled_size<> max_recycled_size=arg::max_recycled_size<>{ 0}) -> std::shared_ptr< bucket_source< T > >
 Create an instance.

Member Function Documentation

◆ bucket_of_size()

template<typename T, bool Blocking = false, bool ClearRecycled = false>
auto tcspc::sharable_recycling_bucket_source< T, Blocking, ClearRecycled >::bucket_of_size ( std::size_t size) -> bucket< T >
inlineoverridevirtual

Implements bucket source requirement.

This function will block if Blocking is true and the maximum bucket count has been reached. It will then unblock when an outstanding bucket is destroyed.

Exceptions
tcspc::buffer_overflow_errorif Blocking is false and the maximum bucket count has been reached.

Implements tcspc::bucket_source< T >.

◆ create()

template<typename T, bool Blocking = false, bool ClearRecycled = false>
auto tcspc::sharable_recycling_bucket_source< T, Blocking, ClearRecycled >::create ( arg::max_bucket_count<> max_bucket_count = arg::max_bucket_count{std::numeric_limits<std::size_t>::max()},
arg::max_recycled_size<> max_recycled_size = arg::max_recycled_size<>{ 0} ) -> std::shared_ptr< bucket_source< T > >
inlinestatic

Create an instance.

Parameters
max_bucket_countthe maximum number of buckets that can be outstanding from this bucket source at any given time.
max_recycled_sizethe maximum bucket size whose storage is recycled; if 0, recycle all

◆ shared_view_of()

template<typename T, bool Blocking = false, bool ClearRecycled = false>
auto tcspc::sharable_recycling_bucket_source< T, Blocking, ClearRecycled >::shared_view_of ( bucket< T > const & bkt) -> bucket< T const >
inlinenodiscardoverridevirtual

Implements sharable bucket source requirement.

Reimplemented from tcspc::bucket_source< T >.

◆ supports_shared_views()

template<typename T, bool Blocking = false, bool ClearRecycled = false>
auto tcspc::sharable_recycling_bucket_source< T, Blocking, ClearRecycled >::supports_shared_views ( ) const -> bool
inlinenodiscardoverridevirtualnoexcept

Implements sharable bucket source requirement.

Reimplemented from tcspc::bucket_source< T >.


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