Add template-free C++ API #3171
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Since long time, users have been struggling with the templated C++ API of ADIOS2. It makes things unnecessarily hard for users to define and use ADIOS2 variables with data types that are only determined at runtime. It makes things even harder for users who want to put variable objects of different data types into a single container.
It's time to correct this harmful C++ fundamentalism. A C++ code does not have to use templates. Whether to use templates should be determined in a case by case manner.
This PR adds a template-free C++ API, which should be recommended for most use cases instead of the templated API. Some parts of it is currently still built on top of the templated API, but we should aim to remove most of the templated implementations in ADIOS2 core so we will save a huge lot of type conversions and macros that cut off the debugger processes.
This is also inline with the user defined data type work.