1#ifndef PRESIO_METRIC_PLUGIN
2#define PRESIO_METRIC_PLUGIN
9#include <std_compat/span.h>
114 compat::span<const pressio_data* const>
const& outputs);
120 compat::span<const pressio_data* const>
const& outputs,
int rc);
126 compat::span<const pressio_data* const>
const& outputs);
132 compat::span<const pressio_data* const>
const& outputs,
int rc);
147 void set_name(std::
string const& new_name) override final;
243 compat::span<const
pressio_data* const> const& outputs);
249 compat::span<const
pressio_data* const> const& outputs,
int rc);
255 compat::span<const
pressio_data* const> const& outputs);
261 compat::span<const
pressio_data* const> const& outputs,
int rc);
273 pressio_metrics(std::unique_ptr<libpressio_metrics_plugin>&& metrics): plugin(std::move(metrics)) {}
275 pressio_metrics(std::shared_ptr<libpressio_metrics_plugin>&& metrics): plugin(std::move(metrics)) {}
287 if(&metrics ==
this)
return *
this;
288 plugin = metrics->
clone();
306 operator bool()
const {
return plugin.
get() !=
nullptr; }
309 std::shared_ptr<libpressio_metrics_plugin> plugin;
315std::unique_ptr<libpressio_metrics_plugin>
make_m_composite(std::vector<pressio_metrics>&& plugins);
virtual pressio_options get_metrics_results(pressio_options const &options)=0
virtual pressio_options get_documentation_impl() const =0
int end_decompress_many(compat::span< const pressio_data *const > const &inputs, compat::span< const pressio_data *const > const &outputs, int rc)
int begin_get_documentation()
int end_decompress(struct pressio_data const *input, pressio_data const *output, int rc)
virtual int begin_decompress_many_impl(compat::span< const pressio_data *const > const &inputs, compat::span< const pressio_data *const > const &outputs)
virtual int end_compress_impl(struct pressio_data const *input, pressio_data const *output, int rc)
virtual int begin_get_configuration_impl()
int end_get_configuration(struct pressio_options const &ret)
virtual int end_check_options_impl(struct pressio_options const *options, int rc)
int begin_compress(const struct pressio_data *input, struct pressio_data const *output)
int end_get_documentation(struct pressio_options const &ret)
virtual int begin_compress_many_impl(compat::span< const pressio_data *const > const &inputs, compat::span< const pressio_data *const > const &outputs)
virtual int begin_compress_impl(const struct pressio_data *input, struct pressio_data const *output)
int end_compress_many(compat::span< const pressio_data *const > const &inputs, compat::span< const pressio_data *const > const &outputs, int rc)
virtual int end_compress_many_impl(compat::span< const pressio_data *const > const &inputs, compat::span< const pressio_data *const > const &outputs, int rc)
int begin_check_options(struct pressio_options const *options)
virtual pressio_options get_documentation() const final
int begin_get_configuration()
virtual int end_decompress_impl(struct pressio_data const *input, pressio_data const *output, int rc)
int end_set_options(struct pressio_options const &options, int rc)
int end_compress(struct pressio_data const *input, pressio_data const *output, int rc)
virtual std::unique_ptr< libpressio_metrics_plugin > clone()=0
virtual int end_get_documentation_impl(struct pressio_options const &ret)
virtual int begin_get_options_impl()
int begin_decompress_many(compat::span< const pressio_data *const > const &inputs, compat::span< const pressio_data *const > const &outputs)
int begin_set_options(struct pressio_options const &options)
int end_check_options(struct pressio_options const *options, int rc)
virtual int begin_decompress_impl(struct pressio_data const *input, pressio_data const *output)
int end_get_options(struct pressio_options const *ret)
virtual int end_decompress_many_impl(compat::span< const pressio_data *const > const &inputs, compat::span< const pressio_data *const > const &outputs, int rc)
libpressio_metrics_plugin()
virtual int end_get_configuration_impl(struct pressio_options const &ret)
virtual int begin_get_documentation_impl()
int begin_decompress(struct pressio_data const *input, pressio_data const *output)
void set_name(std::string const &new_name) override final
virtual int end_get_options_impl(struct pressio_options const *ret)
virtual int begin_set_options_impl(struct pressio_options const &options)
virtual int begin_check_options_impl(struct pressio_options const *options)
virtual int end_set_options_impl(struct pressio_options const &options, int rc)
int begin_compress_many(compat::span< const pressio_data *const > const &inputs, compat::span< const pressio_data *const > const &outputs)
virtual ~libpressio_metrics_plugin()=default
Definition: configurable.h:17
enum pressio_options_key_status get(pressio_options const &options, StringType &&key, PointerType value) const
Definition: configurable.h:127
interface for configurable types
interface for types which can report and have errors
std::unique_ptr< libpressio_metrics_plugin > make_m_composite(std::vector< pressio_metrics > &&plugins)
Definition: metrics.h:270
pressio_metrics(pressio_metrics &&metrics)=default
pressio_metrics(std::unique_ptr< libpressio_metrics_plugin > &&metrics)
Definition: metrics.h:273
pressio_metrics & operator=(pressio_metrics const &metrics)
Definition: metrics.h:286
libpressio_metrics_plugin * operator->() const noexcept
Definition: metrics.h:302
pressio_metrics()=default
pressio_metrics(pressio_metrics const &metrics)
Definition: metrics.h:282
pressio_metrics & operator=(pressio_metrics &&metrics)=default
pressio_metrics(std::shared_ptr< libpressio_metrics_plugin > &&metrics)
Definition: metrics.h:275
libpressio_metrics_plugin & operator*() const noexcept
Definition: metrics.h:304
Definition: options.h:352
interface for versionable types