libpressio 0.93.0
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
libpressio_compressor_plugin Class Referenceabstract

#include <compressor.h>

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

Public Member Functions

 libpressio_compressor_plugin (libpressio_compressor_plugin const &plugin)
 
libpressio_compressor_pluginoperator= (libpressio_compressor_plugin const &plugin)
 
 libpressio_compressor_plugin (libpressio_compressor_plugin &&plugin) noexcept
 
libpressio_compressor_pluginoperator= (libpressio_compressor_plugin &&plugin) noexcept
 
virtual ~libpressio_compressor_plugin ()
 
struct pressio_options get_metrics_options () const
 
struct pressio_options get_options () const override final
 
int check_options (struct pressio_options const &options) override final
 
struct pressio_options get_configuration () const override final
 
struct pressio_options get_documentation () const override final
 
int set_options (struct pressio_options const &options) override final
 
int set_metrics_options (struct pressio_options const &options)
 
int compress (struct pressio_data const *input, struct pressio_data *output)
 
int decompress (struct pressio_data const *input, struct pressio_data *output)
 
template<class InputRandomAccessIterator , class InputRandomAccessIteratorEnd , class OutputRandomAccessIterator , class OutputRandomAccessIteratorEnd >
int compress_many (InputRandomAccessIterator in_begin, InputRandomAccessIteratorEnd in_end, OutputRandomAccessIterator out_begin, OutputRandomAccessIteratorEnd out_end)
 
template<class InputRandomAccessIterator , class InputRandomAccessIteratorEnd , class OutputRandomAccessIterator , class OutputRandomAccessIteratorEnd >
int decompress_many (InputRandomAccessIterator in_begin, InputRandomAccessIteratorEnd in_end, OutputRandomAccessIterator out_begin, OutputRandomAccessIteratorEnd out_end)
 
struct pressio_options get_metrics_results () const
 
struct pressio_metrics && get_metrics () &&
 
struct pressio_metrics get_metrics () const &
 
void set_metrics (struct pressio_metrics &plugin)
 
void set_metrics (struct pressio_metrics &&plugin)
 
virtual std::shared_ptr< libpressio_compressor_pluginclone ()=0
 
void set_name (std::string const &new_name) override final
 
- Public Member Functions inherited from pressio_configurable
virtual const char * prefix () const =0
 
std::string const & get_name () const
 
virtual void set_name (std::string const &new_name)
 
virtual void set_name_impl (std::string const &new_name)
 
virtual struct pressio_options get_configuration () const
 
virtual struct pressio_options get_documentation () const
 
virtual int check_options (struct pressio_options const &)
 
virtual struct pressio_options get_options () const
 
virtual int set_options (struct pressio_options const &options)
 
int cast_options (pressio_options const &early_config, pressio_options const &config)
 
- Public Member Functions inherited from pressio_errorable
const char * error_msg () const
 
int error_code () const
 
- Public Member Functions inherited from pressio_versionable
virtual ~pressio_versionable ()=default
 
virtual const char * version () const =0
 
virtual uint64_t epoch_version () const
 
virtual int major_version () const
 
virtual int minor_version () const
 
virtual int patch_version () const
 

Protected Member Functions

virtual struct pressio_options get_options_impl () const =0
 
virtual struct pressio_options get_documentation_impl () const =0
 
virtual struct pressio_options get_configuration_impl () const =0
 
virtual int set_options_impl (struct pressio_options const &options)=0
 
virtual int compress_impl (const pressio_data *input, struct pressio_data *output)=0
 
virtual int decompress_impl (const pressio_data *input, struct pressio_data *output)=0
 
virtual int check_options_impl (struct pressio_options const &)
 
virtual struct pressio_options get_metrics_results_impl () const
 
virtual int decompress_many_impl (compat::span< const pressio_data *const > const &inputs, compat::span< pressio_data * > &outputs)
 
virtual int compress_many_impl (compat::span< const pressio_data *const > const &inputs, compat::span< pressio_data * > &outputs)
 
- Protected Member Functions inherited from pressio_configurable
template<class StringType >
void set (pressio_options &options, StringType const &key, pressio_option const &value) const
 
template<class StringType >
void set_type (pressio_options &options, StringType const &key, pressio_option_type type) const
 
template<class StringType , class PointerType >
enum pressio_options_key_status get (pressio_options const &options, StringType &&key, PointerType value) const
 
template<class StringType , class Wrapper , class... Args>
void set_meta (pressio_options &options, StringType &&key, std::string const &current_id, Wrapper const &current_value, Args &&... args) const
 
template<class StringType , class Wrapper , class... Args>
void set_meta_docs (pressio_options &options, StringType &&key, std::string const &docstring, Wrapper const &current_value, Args &&... args) const
 
template<class StringType , class Wrapper , class Registry , class... Args>
void set_meta_configuration (pressio_options &options, StringType &&key, Registry const &registry, Wrapper const &current_value) const
 
template<class StringType , class Wrapper , class Registry , class... Args>
void set_meta_many_configuration (pressio_options &options, StringType &&key, Registry const &registry, std::vector< Wrapper > const &current_values) const
 
template<class StringType , class Wrapper , class... Args>
void set_meta_many_docs (pressio_options &options, StringType &&key, std::string const &docstring, std::vector< Wrapper > const &current_values, Args &&... args) const
 
template<class StringType , class Wrapper , class... Args>
void set_meta_many (pressio_options &options, StringType &&key, std::vector< std::string > const &current_ids, std::vector< Wrapper > const &current_values, Args &&... args) const
 
template<class StringType , class Registry , class Wrapper >
pressio_options_key_status get_meta (pressio_options const &options, StringType &&key, Registry const &registry, std::string &current_id, Wrapper &current_value)
 
template<class StringType , class Registry , class Wrapper >
pressio_options_key_status get_meta_many (pressio_options const &options, StringType &&key, Registry const &registry, std::vector< std::string > &current_ids, std::vector< Wrapper > &current_values)
 
template<class T >
void set_names_many (std::string const &name, std::vector< T > &plugins, std::vector< std::string > const &names) const
 
std::string get_metrics_key_name () const
 
- Protected Member Functions inherited from pressio_errorable
int set_error (int code, std::string const &msg)
 
void clear_error ()
 

Additional Inherited Members

- Static Protected Member Functions inherited from pressio_configurable
static pressio_thread_safety get_threadsafe (pressio_configurable const &c)
 
- Protected Attributes inherited from pressio_configurable
std::string name
 

Detailed Description

plugin to provide a new compressor

Constructor & Destructor Documentation

◆ libpressio_compressor_plugin() [1/2]

libpressio_compressor_plugin::libpressio_compressor_plugin ( libpressio_compressor_plugin const &  plugin)
inline

copy construct a compressor plugin by cloning the plugin

Parameters
[in]pluginthe plugin to clone

◆ libpressio_compressor_plugin() [2/2]

libpressio_compressor_plugin::libpressio_compressor_plugin ( libpressio_compressor_plugin &&  plugin)
inlinenoexcept

move construct a compressor plugin by cloning the plugin

Parameters
[in]pluginthe plugin to clone

◆ ~libpressio_compressor_plugin()

virtual libpressio_compressor_plugin::~libpressio_compressor_plugin ( )
virtual

compressor should free their global memory in the destructor

Member Function Documentation

◆ check_options()

int libpressio_compressor_plugin::check_options ( struct pressio_options const &  options)
finaloverridevirtual

checks the options for a compresor, handles metrics calls

See also
check_options_impl for the actual functions to call

Reimplemented from pressio_configurable.

◆ check_options_impl()

virtual int libpressio_compressor_plugin::check_options_impl ( struct pressio_options const &  )
protectedvirtual

checks for extra arguments set for the compressor. Unlike other functions, this option is NOT required

See also
pressio_compressor_check_options for semantics this function obeys

◆ clone()

virtual std::shared_ptr< libpressio_compressor_plugin > libpressio_compressor_plugin::clone ( )
pure virtual
Returns
a copy of each a compressor and its configuration. If the compressor is not thread-safe and indicates such via its configuration, it may return a new shared pointer to the same object. For this reason, this function may not be const.

◆ compress()

int libpressio_compressor_plugin::compress ( struct pressio_data const *  input,
struct pressio_data output 
)

compresses a pressio_data buffer

See also
pressio_compressor_compress for the semantics this function should obey

◆ compress_impl()

virtual int libpressio_compressor_plugin::compress_impl ( const pressio_data input,
struct pressio_data output 
)
protectedpure virtual

compresses a pressio_data buffer

See also
pressio_compressor_compress for the semantics this function should obey

◆ compress_many()

template<class InputRandomAccessIterator , class InputRandomAccessIteratorEnd , class OutputRandomAccessIterator , class OutputRandomAccessIteratorEnd >
int libpressio_compressor_plugin::compress_many ( InputRandomAccessIterator  in_begin,
InputRandomAccessIteratorEnd  in_end,
OutputRandomAccessIterator  out_begin,
OutputRandomAccessIteratorEnd  out_end 
)
inline

compresses a pressio_data buffer

Parameters
[in]in_beginiterator to the beginning of the inputs
[in]in_enditerator to the end of the inputs
[in,out]out_beginiterator to the beginning of the outputs
[in,out]out_enditerator to the end of the outputs
See also
pressio_compressor_compress for the semantics this function should obey

◆ compress_many_impl()

virtual int libpressio_compressor_plugin::compress_many_impl ( compat::span< const pressio_data *const > const &  inputs,
compat::span< pressio_data * > &  outputs 
)
protectedvirtual

compress multiple data buffers

◆ decompress()

int libpressio_compressor_plugin::decompress ( struct pressio_data const *  input,
struct pressio_data output 
)

decompress a pressio_data buffer

Parameters
[in]inputinput buffer to compress
[in,out]outputbuffer to decompress
See also
pressio_compressor_decompress for the semantics this function should obey

◆ decompress_impl()

virtual int libpressio_compressor_plugin::decompress_impl ( const pressio_data input,
struct pressio_data output 
)
protectedpure virtual

decompress a pressio_data buffer

See also
pressio_compressor_decompress for the semantics this function should obey

◆ decompress_many()

template<class InputRandomAccessIterator , class InputRandomAccessIteratorEnd , class OutputRandomAccessIterator , class OutputRandomAccessIteratorEnd >
int libpressio_compressor_plugin::decompress_many ( InputRandomAccessIterator  in_begin,
InputRandomAccessIteratorEnd  in_end,
OutputRandomAccessIterator  out_begin,
OutputRandomAccessIteratorEnd  out_end 
)
inline

decompress a pressio_data buffer

Parameters
[in]in_beginiterator to the beginning of the inputs
[in]in_enditerator to the end of the inputs
[in,out]out_beginiterator to the beginning of the outputs
[in,out]out_enditerator to the end of the outputs
See also
pressio_compressor_decompress for the semantics this function should obey

◆ decompress_many_impl()

virtual int libpressio_compressor_plugin::decompress_many_impl ( compat::span< const pressio_data *const > const &  inputs,
compat::span< pressio_data * > &  outputs 
)
protectedvirtual

decompress multiple data buffers

◆ get_configuration()

struct pressio_options libpressio_compressor_plugin::get_configuration ( ) const
finaloverridevirtual

get the compile time configuration of a compressor, handles metrics calls

See also
pressio_compressor_get_configuration for the semantics this function should obey

Reimplemented from pressio_configurable.

◆ get_configuration_impl()

virtual struct pressio_options libpressio_compressor_plugin::get_configuration_impl ( ) const
protectedpure virtual

get a set of compile-time configurations for the compressor.

See also
pressio_compressor_get_configuration for the semantics this function should obey

◆ get_documentation()

struct pressio_options libpressio_compressor_plugin::get_documentation ( ) const
finaloverridevirtual

get the documentation of a compressor, handles metrics calls

See also
pressio_compressor_get_documentation for the semantics this function should obey

Reimplemented from pressio_configurable.

◆ get_documentation_impl()

virtual struct pressio_options libpressio_compressor_plugin::get_documentation_impl ( ) const
protectedpure virtual

get a set of documentation for the compressor.

See also
pressio_compressor_get_documentation for the semantics this function should obey

◆ get_metrics() [1/2]

struct pressio_metrics && libpressio_compressor_plugin::get_metrics ( ) &&
Returns
the moved configured libpressio_metricsplugin plugin

◆ get_metrics() [2/2]

struct pressio_metrics libpressio_compressor_plugin::get_metrics ( ) const &
Returns
a copy of configured libpressio_metricsplugin plugin

◆ get_metrics_options()

struct pressio_options libpressio_compressor_plugin::get_metrics_options ( ) const

get a set of metrics options available for the compressor.

See also
pressio_metrics_set_options for metrics options

◆ get_metrics_results()

struct pressio_options libpressio_compressor_plugin::get_metrics_results ( ) const
Returns
a pressio_options structure containing the metrics returned by the provided metrics plugin
See also
libpressio_metricsplugin for how to compute results

◆ get_metrics_results_impl()

virtual struct pressio_options libpressio_compressor_plugin::get_metrics_results_impl ( ) const
protectedvirtual

profiling statistics for the particular compressor. i.e. the number of bytes used by a particular phase of a compressor, compressor-specific performance counters. Will be inserted into the metrics returned by the metrics plugin if possible. The default returns an empty structure.

All names returned should be properly prefixed

◆ get_options()

struct pressio_options libpressio_compressor_plugin::get_options ( ) const
finaloverridevirtual

get a set of options available for the configurable object.

The compressor should set a value if they have been set as default The compressor should set a "reset" value if they are required to be set, but don't have a meaningful default

See also
pressio_compressor_get_options for the semantics this function should obey
pressio_options_clear to set a "reset" value
pressio_options_set_integer to set an integer value
pressio_options_set_double to set an double value
pressio_options_set_userptr to set an data value, include an include/ext/<my_plugin>.h to define the structure used
pressio_options_set_string to set a string value

Reimplemented from pressio_configurable.

◆ get_options_impl()

virtual struct pressio_options libpressio_compressor_plugin::get_options_impl ( ) const
protectedpure virtual

get a set of options available for the compressor.

The compressor should set a value if they have been set as default The compressor should set a "reset" value if they are required to be set, but don't have a meaningful default

See also
pressio_compressor_get_options for the semantics this function should obey
pressio_options_clear to set a "reset" value
pressio_options_set_integer to set an integer value
pressio_options_set_double to set an double value
pressio_options_set_userptr to set an data value, include an include/ext/<my_plugin>.h to define the structure used
pressio_options_set_string to set a string value

◆ operator=() [1/2]

libpressio_compressor_plugin & libpressio_compressor_plugin::operator= ( libpressio_compressor_plugin &&  plugin)
inlinenoexcept

move assign a compressor plugin by cloning the plugin

Parameters
[in]pluginthe plugin to clone

◆ operator=() [2/2]

libpressio_compressor_plugin & libpressio_compressor_plugin::operator= ( libpressio_compressor_plugin const &  plugin)
inline

copy assign a compressor plugin by cloning the plugin

Parameters
[in]pluginthe plugin to clone

◆ set_metrics() [1/2]

void libpressio_compressor_plugin::set_metrics ( struct pressio_metrics &&  plugin)
Parameters
[in]pluginthe configured libpressio_metricsplugin plugin to use

◆ set_metrics() [2/2]

void libpressio_compressor_plugin::set_metrics ( struct pressio_metrics plugin)
Parameters
[in]pluginthe configured libpressio_metricsplugin plugin to use

◆ set_metrics_options()

int libpressio_compressor_plugin::set_metrics_options ( struct pressio_options const &  options)

sets a set of metrics options for the compressor

Parameters
[in]optionsto set for configuration of the metrics
See also
pressio_metrics_set_options for the semantics this function should obey

◆ set_name()

void libpressio_compressor_plugin::set_name ( std::string const &  new_name)
finaloverridevirtual

sets the name of the metrics plugin

Reimplemented from pressio_configurable.

◆ set_options()

int libpressio_compressor_plugin::set_options ( struct pressio_options const &  options)
finaloverridevirtual

sets a set of options for the compressor, handles metrics calls

Parameters
[in]optionsto set for configuration of the compressor
See also
pressio_compressor_set_options for the semantics this function should obey

Reimplemented from pressio_configurable.

◆ set_options_impl()

virtual int libpressio_compressor_plugin::set_options_impl ( struct pressio_options const &  options)
protectedpure virtual

sets a set of options for the compressor

Parameters
[in]optionsto set for configuration of the compressor
See also
pressio_compressor_set_options for the semantics this function should obey

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