libfilezilla
Public Member Functions | List of all members
file_reader_factory Class Referencefinal

Factory for. More...

#include <reader.hpp>

Inheritance diagram for file_reader_factory:
Inheritance graph
[legend]
Collaboration diagram for file_reader_factory:
Collaboration graph
[legend]

Public Member Functions

 file_reader_factory (std::wstring const &file, thread_pool &tpool)
 
virtual std::unique_ptr< reader_baseopen (aio_buffer_pool &pool, uint64_t offset=0, uint64_t size=reader_base::nosize, size_t max_buffers=4) override
 Creates a reader. More...
 
virtual std::unique_ptr< reader_factoryclone () const override
 Clones the factory.
 
virtual bool seekable () const override
 
virtual uint64_t size () const override
 
virtual datetime mtime () const override
 
virtual bool multiple_buffer_usage () const override
 Whether the reader can benefit from multiple buffers. More...
 
virtual size_t preferred_buffer_count () const override
 
- Public Member Functions inherited from reader_factory
 reader_factory (std::wstring const &name)
 
 reader_factory (std::wstring &&name)
 
std::wstring name () const
 
virtual size_t min_buffer_usage () const
 The reader requires at least this many buffers. More...
 

Additional Inherited Members

- Protected Member Functions inherited from reader_factory
 reader_factory (reader_factory const &)=default
 
- Protected Attributes inherited from reader_factory
std::wstring const name_
 

Detailed Description

Factory for.

See also
file_reader

Member Function Documentation

◆ multiple_buffer_usage()

virtual bool multiple_buffer_usage ( ) const
inlineoverridevirtual

Whether the reader can benefit from multiple buffers.

If false, calling open with max_buffers larger than min_buffer_usage() offers no benefits.

Reimplemented from reader_factory.

◆ open()

virtual std::unique_ptr<reader_base> open ( aio_buffer_pool pool,
uint64_t  offset = 0,
uint64_t  size = reader_base::nosize,
size_t  max_buffers = 4 
)
overridevirtual

Creates a reader.

The pool must live longer than the returned reader.

Seekable readers can be opened at any position. If the reader is not seekable, pass an offset of 0 or open will fails.

size can limit the amount of data the reader can returned. Note that a size limit that exceeds the actual size will result in reader_base::get_buffer eventually returning an error.

Implements reader_factory.


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