1#ifndef PRESSIO_IO_PLUGIN_H
2#define PRESSIO_IO_PLUGIN_H
8#include <std_compat/span.h>
44 template <
class ContigIterator>
45 int read_many(ContigIterator data_begin, ContigIterator data_end) {
47 compat::span<struct pressio_data*> data(data_begin, data_end);
66 template <
class ContigIterator>
67 int write_many(ContigIterator data_begin, ContigIterator data_end) {
69 compat::span<const struct pressio_data*> data(data_begin, data_end);
112 virtual std::shared_ptr<libpressio_io_plugin>
clone()=0;
149 return set_error(1,
"read many not supported");
158 return set_error(1,
"write many not supported");
215 if(&io ==
this)
return *
this;
229 operator bool()
const {
246 std::shared_ptr<libpressio_io_plugin>
plugin;
Definition: configurable.h:17
int set_error(int code, std::string const &msg)
Definition: versionable.h:11
interface for configurable types
interface for types which can report and have errors
virtual int read_many_impl(compat::span< struct pressio_data * > const &data)
Definition: io.h:147
virtual pressio_data * read_impl(struct pressio_data *data)=0
virtual struct pressio_options get_options_impl() const =0
virtual struct pressio_options get_configuration_impl() const =0
virtual int check_options_impl(struct pressio_options const &)
int write_many(ContigIterator data_begin, ContigIterator data_end)
Definition: io.h:67
virtual struct pressio_options get_documentation_impl() const =0
virtual std::shared_ptr< libpressio_io_plugin > clone()=0
struct pressio_data * read(struct pressio_data *data)
struct pressio_options get_documentation() const override final
void set_name(std::string const &new_name) final
int set_options(struct pressio_options const &options) override final
int check_options(struct pressio_options const &) override final
int read_many(ContigIterator data_begin, ContigIterator data_end)
Definition: io.h:45
int write(struct pressio_data const *data)
virtual int write_impl(struct pressio_data const *data)=0
virtual int write_many_impl(compat::span< struct pressio_data const * > const &data)
Definition: io.h:156
virtual int set_options_impl(struct pressio_options const &options)=0
struct pressio_options get_configuration() const override final
struct pressio_options get_options() const override final
libpressio_io_plugin * operator->() const noexcept
Definition: io.h:239
pressio_io & operator=(pressio_io &&io)=default
pressio_io(std::shared_ptr< libpressio_io_plugin > &&impl)
Definition: io.h:202
pressio_io(std::unique_ptr< libpressio_io_plugin > &&impl)
Definition: io.h:198
pressio_io(pressio_io const &io)
Definition: io.h:210
std::shared_ptr< libpressio_io_plugin > plugin
Definition: io.h:246
pressio_io & operator=(pressio_io const &io)
Definition: io.h:214
libpressio_io_plugin & operator*() const noexcept
Definition: io.h:234
pressio_io(pressio_io &&io)=default
Definition: options.h:352
interface for versionable types