-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Major Changes + Added a noop IO module to make it easier to disable IO + Added `supported_metrics()` and `supported_io()` methods to struct pressio for symmetry + Added `pressio_supported_metrics()` methods + BREAKING CHANGE: pressio_supported_compressors() now returns a static string based on what is found in the registry. While this should normally be the consistent with LIBPRESSIO_COMPRESSORS, it won't include external compressors. This change better conforms with the documented and intended behavior. Bug Fixes: + The POSIX pressio_io_data_fwrite function now correctly returns the number of bytes written as documented. Previously it returned the number of objects written. + The POSIX io module now returns error messages on failures + the POSIX io module no longer initializes file_ptr to nullptr to avoid a bug where it is intentionally set.
- Loading branch information
Showing
6 changed files
with
141 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#include <sys/stat.h> | ||
#include <unistd.h> | ||
#include <vector> | ||
#include "pressio_data.h" | ||
#include "pressio_compressor.h" | ||
#include "libpressio_ext/io/posix.h" | ||
#include "libpressio_ext/cpp/pressio.h" | ||
#include "libpressio_ext/cpp/options.h" | ||
#include "libpressio_ext/cpp/data.h" | ||
#include "libpressio_ext/cpp/io.h" | ||
|
||
struct noop_io : public libpressio_io_plugin { | ||
virtual struct pressio_data* read_impl(struct pressio_data* data) override { | ||
if(data != nullptr) pressio_data_free(data); | ||
return nullptr; | ||
} | ||
|
||
virtual int write_impl(struct pressio_data const*) override{ | ||
return 0; | ||
} | ||
virtual struct pressio_options get_configuration_impl() const override{ | ||
return { | ||
{"pressio:thread_safe", static_cast<int>(pressio_thread_safety_multiple)} | ||
}; | ||
} | ||
|
||
virtual int set_options_impl(struct pressio_options const&) override{ | ||
return 0; | ||
} | ||
virtual struct pressio_options get_options_impl() const override{ | ||
return {}; | ||
} | ||
|
||
int patch_version() const override{ | ||
return 1; | ||
} | ||
virtual const char* version() const override{ | ||
return "0.0.1"; | ||
} | ||
|
||
private: | ||
}; | ||
|
||
static pressio_register X(io_plugins(), "noop", [](){ return compat::make_unique<noop_io>(); }); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters