15 #ifndef THRILL_DATA_DYN_BLOCK_READER_HEADER 16 #define THRILL_DATA_DYN_BLOCK_READER_HEADER 38 virtual void Prefetch(
size_t size) = 0;
56 : block_source_ptr_(
std::move(block_source_ptr)) { }
59 return block_source_ptr_->NextBlock();
63 return block_source_ptr_->Prefetch(size);
77 template <
typename BlockSource>
82 : block_source_(
std::move(block_source)) { }
94 return block_source_.NextBlock();
98 return block_source_.Prefetch(size);
110 template <
typename BlockSource,
typename... Params>
114 BlockSource(std::forward<Params>(
params) ...)));
122 template <
typename BlockSource,
typename... Params>
125 ConstructDynBlockSource<BlockSource>(std::forward<Params>(
params) ...));
133 #endif // !THRILL_DATA_DYN_BLOCK_READER_HEADER tlx::CountingPtr< DynBlockSourceInterface > block_source_ptr_
DynBlockSource(tlx::CountingPtr< DynBlockSourceInterface > &&block_source_ptr)
ReferenceCounter & operator=(const ReferenceCounter &) noexcept
assignment operator, leaves pointers unchanged
PinnedBlock NextBlock() final
virtual PinnedBlock NextBlock()=0
DynBlockSourceAdapter(BlockSource &&block_source)
virtual void Prefetch(size_t size)=0
set number of blocks to prefetch
Adapter class to wrap any existing BlockSource concept class into a DynBlockSourceInterface.
void Prefetch(size_t size) final
set number of blocks to prefetch
This is a pure virtual base which will be used to fetch Blocks for the BlockReader from different sou...
void Prefetch(size_t size)
virtual ~DynBlockSourceInterface()
BlockReader takes Block objects from BlockSource and allows reading of a) serializable Items or b) ar...
CountingPtr< Type > make_counting(Args &&... args)
method analogous to std::make_shared and std::make_unique.
High-performance smart pointer used as a wrapping reference counting pointer.
DynBlockSource ConstructDynBlockSource(Params &&... params)
Method to construct a DynBlockSource from a non-polymorphic BlockSource.
A pinned / pin-counted derivative of a Block.
BlockReader< DynBlockSource > DynBlockReader
Instantiation of BlockReader for reading from the polymorphic source.
BlockSource block_source_
Provides reference counting abilities for use with CountingPtr.
This is the actual BlockSource used to instantiate BlockReader.
DynBlockReader ConstructDynBlockReader(Params &&... params)
Method to construct a DynBlockReader from a non-polymorphic BlockSource.