dune-grid  2.3beta2
Public Member Functions | List of all members
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
bool beginAppended ()
 signal start of the appeneded section
const std::string & appendedEncoding () const
 query encoding string for appended data
template<typename T >
DataArrayWriter< T > * make (const std::string &name, unsigned ncomps, unsigned nitems, const Indent &indent)
 create a DataArrayWriter

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

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

const std::string& Dune::VTK::DataArrayWriterFactory::appendedEncoding ( ) const
inline

query encoding string for appended data

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

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

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

signal start of the appeneded 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, and Dune::VTK::base64.

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

template<typename T >
DataArrayWriter<T>* Dune::VTK::DataArrayWriterFactory::make ( const std::string &  name,
unsigned  ncomps,
unsigned  nitems,
const Indent &  indent 
)
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.

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, and Dune::VTK::base64.

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


The documentation for this class was generated from the following file: