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

#include <writer.hpp>

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

Public Member Functions

 buffer_writer_factory (buffer &b, std::wstring const &name, size_t size_limit)
 
virtual std::unique_ptr< writer_baseopen (aio_buffer_pool &pool, uint64_t offset, writer_base::progress_cb_t progress_cb=nullptr, size_t max_buffers=0) override
 Creates a writer. More...
 
virtual std::unique_ptr< writer_factoryclone () const override
 Clones the factory.
 
- Public Member Functions inherited from writer_factory
 writer_factory (std::wstring const &name)
 
 writer_factory (std::wstring &&name)
 
std::wstring const & name () const
 
virtual bool offsetable () const
 If true, writer can be opened from any position, not just the beginning, such as file_writer.
 
virtual uint64_t size () const
 Some writers, e.g. for files, may have a pre-existing size.
 
virtual datetime mtime () const
 
virtual size_t min_buffer_usage () const
 The writer requires at least this many buffers.
 
virtual bool multiple_buffer_usage () const
 Whether the writer can benefit from multiple buffers.
 
virtual size_t preferred_buffer_count () const
 
virtual bool set_mtime (datetime const &)
 Sets the mtime of the target. More...
 

Additional Inherited Members

- Protected Member Functions inherited from writer_factory
 writer_factory (writer_factory const &)=default
 

Detailed Description

Factory for buffer_writer.

The buffer must live longer than the writer. Note that there is no synchronization. Never open two writers for the same buffer in different threads, or access the buffer from any other thread while there is a writer.

Member Function Documentation

◆ open()

virtual std::unique_ptr<writer_base> open ( aio_buffer_pool pool,
uint64_t  offset,
writer_base::progress_cb_t  progress_cb = nullptr,
size_t  max_buffers = 0 
)
overridevirtual

Creates a writer.

The pool must live longer than the returned writer.

Offsetable writers can be opened at any position. If the writer is not seekable, pass an offset of 0 or open will fail.

Implements writer_factory.


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