Suggestions for improving the HDF5 reader module interface and registering the writer and reader
Created by: SkyToGround
I have found the interface to the reader part of the writer modules could be improved. The same goes for the interface for registering the writer and the reader. Suggestions for how this could be done are listed below:
- Use
std::string
for registering both the reader and writer part of a file writing module. The reader part currently usesstd::array<char,4>
. - Force the developer of a module to register both the reader part and the writer part at the same time as both are required anyways.
- As the reader part of the module probably should not keep track of any state and no reader module actually does keep track of any state currently, it would be a bit simpler to have
FileWriter::FlatbufferReader::verify()
,FileWriter::FlatbufferReader::source_name()
andFileWriter::FlatbufferReader::timestamp()
be regular functions and pass pointers to these around usingstd::function<>
. - I see some arguments for combining
FileWriter::FlatbufferReader::source_name()
andFileWriter::FlatbufferReader::timestamp()
into one single function (e.g.)FileWriter::FlatbufferReader::message_info()
. This would simplify the code a bit and probably result in less code being executed overall.
Feel free to comment on these suggestions @dominikwerder , @michele-brambilla , @matthew-d-jones .