diff --git a/src/Utils.hpp b/src/Utils.hpp index 28482c45..5e401d3c 100644 --- a/src/Utils.hpp +++ b/src/Utils.hpp @@ -1,7 +1,10 @@ +#pragma once + #include #include #include #include +#include #include #include @@ -12,6 +15,7 @@ #include "io/BaseIO.hpp" #include "io/hdf5/HDF5IO.hpp" + namespace AQNWB { /** @@ -62,7 +66,7 @@ inline std::shared_ptr createIO(const std::string& type, const std::string& filename) { if (type == "HDF5") { - return std::make_shared(filename); + return std::make_shared(filename); } else { throw std::invalid_argument("Invalid IO type"); } @@ -92,4 +96,5 @@ inline std::unique_ptr transformToInt16(SizeType numSamples, return intData; } + } // namespace AQNWB diff --git a/src/io/ReadIO.hpp b/src/io/ReadIO.hpp index 5ecac8bb..15ea8312 100644 --- a/src/io/ReadIO.hpp +++ b/src/io/ReadIO.hpp @@ -12,6 +12,7 @@ #include "Types.hpp" + using StorageObjectType = AQNWB::Types::StorageObjectType; using SizeType = AQNWB::Types::SizeType; @@ -52,6 +53,19 @@ class DataBlockGeneric * correct type. */ std::type_index typeIndex = typeid(void); + + /** + * \brief Default constructor + */ + DataBlockGeneric() = default; + + /** + * \brief Parameterized constructor + */ + DataBlockGeneric(const std::any& data, const std::vector& shape, const std::type_index& typeIndex) + : data(data), shape(shape), typeIndex(typeIndex) + { + } }; /** @@ -78,7 +92,9 @@ class DataBlock */ const std::type_index typeIndex = typeid(DTYPE); - /// Constructor + /** + * Constructor + */ DataBlock(const std::vector& data, const std::vector& shape) : data(data) , shape(shape) @@ -146,7 +162,7 @@ class DataBlock * AQNWB::Types::StorageObjectType * @tparam VTYPE The data type of the values stored in the data object */ -template +template class ReadDataWrapper { // Embedded traits for compile time checking of allowed OTYPE for the class @@ -199,8 +215,12 @@ class ReadDataWrapper public: /** * @brief Default constructor. + * + * @param io The IO object to use for reading + * @param dataPath The path to the attribute or dataset to read */ - ReadDataWrapper(const std::shared_ptr io, std::string dataPath) + ReadDataWrapper(const std::shared_ptr io, + const std::string& dataPath) : io(io) , dataPath(dataPath) {