<aside> 💡 The “stream_provider” operator allows to open a stream on the result files given in the data sources. It provides a plugin specific streams which allows to cache data in order to access file’s content faster. Caching the mesh, file addressing or other often accessed entity can improve performance.
</aside>
The specification allows to document each operator. For consistency, the specification can be used through different reader plugins.
struct CustomReaderStreamProvider
{
// TO DO: rename "custom_solver" to the real solver name
static std::string name() { return "custom_solver::stream_provider"; }
static void run(ansys::dpf::OperatorMain& main);
static ansys::dpf::OperatorSpecification specification()
{
ansys::dpf::OperatorSpecification spec;
spec.setDocumentation("Creates streams (files with cache) from the data sources.");
spec.setInputPins(
{
ansys::dpf::PinDefinition(ansys::dpf::eDataSourcesPin).setName("data_sources").setAcceptedTypes({ ansys::dpf::types::data_sources }).setDoc("result file path container"),
});
spec.setOutputPins(
{
ansys::dpf::PinDefinition(0).setName("streams_container").setAcceptedTypes({ ansys::dpf::types::streams }).setDoc("streams"),
});
spec.setProperty(ansys::dpf::spec::exposure::sExposure, ansys::dpf::spec::exposure::sPrivate);
return spec;
}
};
For the "run" method implementation, refer to here:
To understand how a Stream accessing results can be implemented refer to: