Skip to content

madsExperimentalBranch

Mads Bregenholt Jakobsen requested to merge MadsExperimentalBranch into main

This PR applies the following changes:

  • relocate the four compression schemes (no compression, lz4, bitshuffle, zlib) into respective header (.hpp) and source (.cpp) files -- in order to do this, enums and structs that are used throughout the seedee project have been moved from seedee.cpp/h into a separate header file (seedeeStructs.h)
  • the 'utility' functions (e.g., array_to_json, n_elements, get_shape, check_protocol) have been moved from the main seedee.cpp file into a separate utilities/utils.cpp file with respective header file
  • error handling throughout the seedee library is done with a c++11 compliant header only implementation of std::expected (which is c++23) in utilities/expected.hpp via tl::expected. Whenever an error is detected (e.g. faulty json input or similar), then an seedee_Error enum rather than the return value (typically an int) is returned and propagates up through the function calls until it is handled in the get_buffer_size/serialize_ndarray/get_data_size/deserialize_ndarray functions through a return as int through its C interface and currently also as an console output.
  • access to json fields is done through a check .contains("") follows by .at(""). If desired json field is non-existent, then an seedee_Error::INVALID_JSON is reported.
  • const keywords are introduced whenever possible (possible some missed opportunities)
  • the data type and byte order is now handled through enums rather than chars for improved clarity (enum values defined to be corresponding char values for easy conversion to python)
  • rather than having a inheritance of the serializers, there now is a struct Serialzer in serializer.cpp/hpp that contains arrays of function pointers to each of the implementations of the four compressions schemes functions. These pointers are then called in the impl functions in seedee.cpp.
Edited by Mads Bregenholt Jakobsen

Merge request reports