Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Plugins: Common String Helpers (Splash)
Adds ArrayOfString helpers for libSplash write calls. See ComputationalRadiationPhysics/libSplash#220 for the description of the problem. If a user wants to write an array of strings they need to be padded to the longest one. This helper does that. Use it like this: ```C++ #include "plugins/common/stringHelpers.hpp" // [...] // create some strings std::list<std::string> myListOfStr; myListOfStr.push_back("short"); myListOfStr.push_back("middle"); myListOfStr.push_back("loooong"); // convert to splash format helper::GetSplashArrayOfString getSplashArrayOfString; helper::GetSplashArrayOfString::Result myArrOfStr; myArrOfStr = getSplashArrayOfString( myListOfStr ); // splash calls dc->writeGlobalAttribute( threadParams->currentStep, myArrOfStr.colType, "someListOfStr", 1u, /* ndims: 1D array */ Dimensions(myListOfStr.size(),0,0), /* size of 1D array */ &(myArrOfStr.buffers.at(0)) ); ``` Also adds a `helper::` namespace to avoid polluting the `PIConGPU` namespace.
- Loading branch information