class brotli_encoder - 5cript/attender GitHub Wiki
class brotli_encoder
: public attender::producer
| Members | Descriptions |
|---|---|
struct implementation
|
|
public brotli_encoder(brotli_configuration)
|
|
public ~brotli_encoder() |
|
public virtual std::string encoding() const |
return 'br' |
public void set_cut_off(std::size_t input_cutoff) |
Sets the amount of bytes where the buffer is started to be trimmed. |
public void set_minimum_avail(std::size_t min_avail) |
Sets the amount of bytes that the output buffer should have available. |
public std::size_t available_in() const noexcept |
Returns the amount of available bytes in the input buffer. |
public void push(char const * data_begin,std::size_t data_size) |
Do NOT call concurrently with itself or other pushes! |
public void push(std::string const & data) |
Do NOT call concurrently with itself or other pushes! |
public virtual std::size_t available() const |
The amount of available data in the buffer. |
public virtual char const * data() const |
A pointer to the begin of the buffer. |
public virtual bool complete() const |
Returns whether the data production has ended. |
public virtual void has_consumed(std::size_t size) |
The base class calls this function to signal that some data has been consumed. |
public virtual void on_error(boost::system::error_code) |
This function is called when the write function returns an error. |
public virtual void start_production() |
The server calls this function when a consumer is attached. |
public virtual void buffer_locked_do(std::function< void()> const &) const |
Everything within the supplied function is guarded by a mutex that also guards other buffer accesses. |
public void flush() |
Flushes the compressed data to output. Warning not the same as finish. |
public void finish() |
Flushes remaining data to output and completes the compression. |
struct implementation
public brotli_encoder(brotli_configuration)
return 'br'
Sets the amount of bytes where the buffer is started to be trimmed.
Stay well within cachable ranges. definitely less than 512kb.
Sets the amount of bytes that the output buffer should have available.
Do NOT call while operation is in progress.
Returns the amount of available bytes in the input buffer.
Do NOT call concurrently with itself or other pushes!
Do NOT call concurrently with itself or other pushes!
The amount of available data in the buffer.
A pointer to the begin of the buffer.
Returns whether the data production has ended.
The base class calls this function to signal that some data has been consumed.
Always call the base class function at the end of your implementation.
This function is called when the write function returns an error.
Use this to stop any production.
The server calls this function when a consumer is attached.
Everything within the supplied function is guarded by a mutex that also guards other buffer accesses.
Flushes the compressed data to output. Warning not the same as finish.
Flushes remaining data to output and completes the compression.