Dune Core Modules (unstable)

Dune::VTK::DataArrayWriterFactory Class Reference

a factory for DataArrayWriters More...

#include <dune/grid/io/file/vtk/dataarraywriter.hh>

Public Member Functions

 DataArrayWriterFactory (OutputType type_, std::ostream &stream_)
 create a DataArrayWriterFactory More...
 
bool beginAppended ()
 signal start of the appended section More...
 
const std::string & appendedEncoding () const
 query encoding string for appended data
 
DataArrayWritermake (const std::string &name, unsigned ncomps, unsigned nitems, const Indent &indent, Precision prec)
 create a DataArrayWriter More...
 

Detailed Description

a factory for DataArrayWriters

Some types of DataArrayWriters need to communicate data sauch as byte counts between different instances which write to the same stream. This factory will manage that data.

Constructor & Destructor Documentation

◆ DataArrayWriterFactory()

Dune::VTK::DataArrayWriterFactory::DataArrayWriterFactory ( OutputType  type_,
std::ostream &  stream_ 
)
inline

create a DataArrayWriterFactory

Parameters
type_Type of DataArrayWriters to create
stream_The stream that the DataArrayWriters will write to.

Better avoid having multiple active factories on the same stream at the same time. Having an inactive factory (one whose make() method is not called anymore before destruction) around at the same time as an active one should be OK however.

Member Function Documentation

◆ beginAppended()

bool Dune::VTK::DataArrayWriterFactory::beginAppended ( )
inline

signal start of the appended section

This method should be called after the main section has been written, but before the appended section has been started. After this method has been called, a call to make will produce DataArrayWriters suitable for the appended section. The return value of this method signals whether a appended section should be written at all: true means write an appended section, false means don't write an appended section. If an appended section is not needed, the method make() may not be called after a call to this method.

References Dune::VTK::appendedbase64, Dune::VTK::appendedraw, Dune::VTK::ascii, Dune::VTK::base64, and DUNE_THROW.

Referenced by Dune::VTK::VTUWriter::beginAppended().

◆ make()

DataArrayWriter* Dune::VTK::DataArrayWriterFactory::make ( const std::string &  name,
unsigned  ncomps,
unsigned  nitems,
const Indent indent,
Precision  prec 
)
inline

create a DataArrayWriter

Template Parameters
TType of the data to write.
Parameters
nameName of the array to write.
ncompsNumber of components of the vectors in to array.
nitemsNumber of vectors in the array.
indentIndentation to use. This is use as-is for the header and trailer lines, but increase by one level for the actual data.
precthe precision type of the output

The should never be more than one DataArrayWriter on the same stream around. The returned object should be freed with delete.

References Dune::VTK::appendedbase64, Dune::VTK::appendedraw, Dune::VTK::ascii, Dune::VTK::base64, and DUNE_THROW.

Referenced by Dune::VTK::VTUWriter::makeArrayWriter().


The documentation for this class was generated from the following file:
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.80.0 (May 1, 22:29, 2024)