appendRawFormatter Class Reference

Appended raw binary output. More...

Inheritance diagram for appendRawFormatter:
[legend]
Collaboration diagram for appendRawFormatter:
[legend]

Public Member Functions

 appendRawFormatter (std::ostream &os)
 Construct and attach to an output stream. More...
 
virtual ~appendRawFormatter ()=default
 Destructor. More...
 
virtual const vtk::outputOptionsopts () const
 The output is APPEND_BINARY. More...
 
virtual const char * name () const
 Output name for XML type ("append") More...
 
virtual const char * encoding () const
 Output name for append encoding type ("raw") More...
 
virtual uint64_t offset (const uint64_t numbytes)
 Increase the append data offset by numbytes and sizeof(uint64_t). More...
 
virtual bool writeSize (const uint64_t numbytes)
 Write leading size for binary output. More...
 
virtual void write (const uint8_t val)
 
virtual void write (const label val)
 
virtual void write (const float val)
 
virtual void write (const double val)
 
virtual void flush ()
 A no-op for this format. More...
 
- Public Member Functions inherited from formatter
virtual ~formatter ()=default
 Destructor. More...
 
std::ostream & os () noexcept
 Access to the underlying output stream. More...
 
virtual const vtk::outputOptionsopts () const =0
 The format-type / output options. More...
 
virtual const char * name () const =0
 Name for the XML output type or the legacy output type. More...
 
virtual const char * encoding () const =0
 Name for the XML append encoding. More...
 
void quoting (const quoteChar quote)
 Change quoting char for XML attributes (default: SINGLE_QUOTE) More...
 
virtual uint64_t offset (const uint64_t numbytes)
 Increase the append data offset by numbytes and sizeof(uint64_t). More...
 
virtual std::size_t encodedLength (std::size_t n) const
 The encoded length for binary output is pass-through. More...
 
virtual bool writeSize (const uint64_t numbytes)=0
 Write leading size for binary output. More...
 
virtual void write (const uint8_t val)=0
 
virtual void write (const label val)=0
 
virtual void write (const float val)=0
 
virtual void write (const double val)=0
 
virtual void flush ()=0
 Flush encoding, write newline etc. More...
 
void indent ()
 Add indenting according to the current XML tag depth. More...
 
void indent (label n)
 Add indenting of n spaces. More...
 
formatterxmlHeader ()
 Write XML header. More...
 
template<class... Args>
formatterxmlComment (const std::string &text, Args &&... args)
 Write XML comment (at the current indentation level) More...
 
template<class... Args>
formatteropenTag (const word &tagName, Args &&... args)
 Start an XML tag, optionally with attributes. More...
 
template<class... Args>
formatteropenTag (vtk::fileTag t, Args &&... args)
 Start an XML tag, optionally with attributes. More...
 
formattercloseTag (const bool isEmpty=false)
 Finish an XML tag, optional as an empty container. More...
 
formatterendTag (const word &tagName=word::null)
 An end XML tag, optional with sanity check. More...
 
virtual formatterendTag (vtk::fileTag t)
 An end XML tag with sanity check. More...
 
template<class... Args>
formattertag (const word &t, Args &&... args)
 Write XML tag without any attributes. Combines openTag/closeTag. More...
 
template<class... Args>
formattertag (vtk::fileTag t, Args &&... args)
 Write XML tag without any attributes. Combines openTag/closeTag. More...
 
formatterbeginVTKFile (const word &contentType, const word &contentVersion, const bool leaveOpen=false)
 
formatterbeginVTKFile (vtk::fileTag contentType, const word &contentVersion, const bool leaveOpen=false)
 
formatterbeginVTKFile (vtk::fileTag contentType, const bool leaveOpen=false)
 
template<vtk::fileTag ContentType>
formatterbeginVTKFile (bool leaveOpen=false)
 
formatterbeginAppendedData ()
 
formatterbeginBlock (label index, std::string name="")
 Begin "Block" XML section. More...
 
formatterendBlock ()
 End "Block" XML section. More...
 
formatterbeginPiece (label index, std::string name="")
 Begin "Piece" XML section. More...
 
virtual formatterendPiece ()
 End "Piece" XML section. More...
 
formatterDataSet (label index, std::string file="", bool autoName=true)
 Insert a single "DataSet" XML entry tag. More...
 
formatterDataSet (label index, std::string file, std::string name)
 Insert a single "DataSet" XML entry tag. More...
 
template<class Type , direction nComp = 1, int nTuple = 0>
formatterbeginDataArray (const word &dataName, uint64_t payLoad=npos, bool leaveOpen=false)
 Begin "DataArray" XML section. More...
 
template<class Type , direction nComp = 1, int nTuple = 0>
formatterbeginDataArray (const vtk::dataArrayAttr &dataName, uint64_t payLoad=npos, bool leaveOpen=false)
 Begin "DataArray" XML section. More...
 
virtual formatterendDataArray ()
 End "DataArray" XML section. More...
 
template<class Type , direction nComp = 1, int nTuple = 0>
formatterPDataArray (const word &dataName)
 Insert a single "PDataArray" XML entry tag. More...
 
formatterbeginFieldData ()
 Begin "FieldData" XML section. More...
 
formatterbeginCellData ()
 Begin "CellData" XML section. More...
 
formatterbeginPointData ()
 Begin "PointData" XML section. More...
 
virtual formatterendFieldData ()
 End "FieldData" XML section. More...
 
virtual formatterendCellData ()
 End "CellData" XML section. More...
 
virtual formatterendPointData ()
 End "PointData" XML section. More...
 
formatterendAppendedData ()
 End "AppendedData" XML section. More...
 
virtual formatterendVTKFile ()
 End "VTKFile" XML section. More...
 
formatterwriteTimeValue (scalar timeValue)
 Emit "TimeValue" for FieldData (name as per Catalyst output) More...
 
template<class... Args>
formatterxmlAttr (const word &k, const std::string &v, Args &&... args)
 Pair-wise write of XML key/value attributes. More...
 
template<class... Args>
formatterxmlAttr (const word &k, const int32_t v, Args &&... args)
 Pair-wise write of XML key/value attributes. More...
 
template<class... Args>
formatterxmlAttr (const word &k, const int64_t v, Args &&... args)
 Pair-wise write of XML key/value attributes. More...
 
template<class... Args>
formatterxmlAttr (const word &k, const uint64_t v, Args &&... args)
 Pair-wise write of XML key/value attributes. More...
 
template<class... Args>
formatterxmlAttr (const word &k, const scalar v, Args &&... args)
 Pair-wise write of XML key/value attributes. More...
 
template<class... Args>
formatterxmlAttr (const vtk::fileAttr &k, const std::string &v, Args &&... args)
 Pair-wise write of XML key/value attributes. More...
 
template<class... Args>
formatterxmlAttr (const vtk::fileAttr &k, const int32_t v, Args &&... args)
 Pair-wise write of XML key/value attributes. More...
 
template<class... Args>
formatterxmlAttr (const vtk::fileAttr &k, const int64_t v, Args &&... args)
 Pair-wise write of XML key/value attributes. More...
 
template<class... Args>
formatterxmlAttr (const vtk::fileAttr &k, const uint64_t v, Args &&... args)
 Pair-wise write of XML key/value attributes. More...
 
template<class... Args>
formatterxmlAttr (const vtk::fileAttr &k, const scalar v, Args &&... args)
 Pair-wise write of XML key/value attributes. More...
 
template<class Type , direction nComp = 1, int nTuple = 0>
formatteropenDataArray (const word &dataName)
 Open "DataArray" XML tag and leave open (requires a closeTag). More...
 
template<class Type , direction nComp = 1, int nTuple = 0>
formatteropenDataArray (const vtk::dataArrayAttr &dataName)
 Open "DataArray" XML tag and leave open (requires a closeTag). More...
 
template<class... Args>
Foam::vtk::formatterxmlComment (const std::string &text, Args &&... args)
 
template<class... Args>
Foam::vtk::formatteropenTag (const word &tagName, Args &&... args)
 
template<class... Args>
Foam::vtk::formatteropenTag (vtk::fileTag t, Args &&... args)
 
template<class... Args>
Foam::vtk::formattertag (const word &t, Args &&... args)
 
template<class... Args>
Foam::vtk::formattertag (vtk::fileTag t, Args &&... args)
 
template<Foam::vtk::fileTag ContentType>
Foam::vtk::formatterbeginVTKFile (bool leaveOpen)
 
template<class Type , Foam::direction nComp, int nTuple>
Foam::vtk::formatterbeginDataArray (const vtk::dataArrayAttr &dataName, uint64_t payLoad, bool leaveOpen)
 
template<class... Args>
Foam::vtk::formatterxmlAttr (const word &k, const std::string &v, Args &&... args)
 
template<class... Args>
Foam::vtk::formatterxmlAttr (const word &k, const int32_t v, Args &&... args)
 
template<class... Args>
Foam::vtk::formatterxmlAttr (const word &k, const int64_t v, Args &&... args)
 
template<class... Args>
Foam::vtk::formatterxmlAttr (const word &k, const uint64_t v, Args &&... args)
 
template<class... Args>
Foam::vtk::formatterxmlAttr (const word &k, const scalar v, Args &&... args)
 
template<class... Args>
Foam::vtk::formatterxmlAttr (const vtk::fileAttr &k, const std::string &v, Args &&... args)
 
template<class... Args>
Foam::vtk::formatterxmlAttr (const vtk::fileAttr &k, const int32_t v, Args &&... args)
 
template<class... Args>
Foam::vtk::formatterxmlAttr (const vtk::fileAttr &k, const int64_t v, Args &&... args)
 
template<class... Args>
Foam::vtk::formatterxmlAttr (const vtk::fileAttr &k, const uint64_t v, Args &&... args)
 
template<class... Args>
Foam::vtk::formatterxmlAttr (const vtk::fileAttr &k, const scalar v, Args &&... args)
 
template<class Type , Foam::direction nComp, int nTuple>
Foam::vtk::formatterbeginDataArray (const word &dataName, uint64_t payLoad, bool leaveOpen)
 
template<class Type , Foam::direction nComp, int nTuple>
Foam::vtk::formatterPDataArray (const word &dataName)
 

Protected Member Functions

void write (const char *s, std::streamsize n)
 Write. More...
 
 appendRawFormatter (const appendRawFormatter &)=delete
 No copy construct. More...
 
void operator= (const appendRawFormatter &)=delete
 No copy assignment. More...
 
- Protected Member Functions inherited from formatter
bool canWriteAttr (const word &k) const
 
bool canWriteToplevel (const char *what) const
 
template<class Type >
void writeAttr (const word &k, const Type &v)
 Write XML key/value attribute pair (implementation). More...
 
formatterxmlAttr ()
 No-op write XML attribute (for templating code). More...
 
void xmlCommentLoop ()
 No-op XML comment loop (for templating code). More...
 
template<class... Args>
void xmlCommentLoop (const std::string &text, Args &&... args)
 Loop/output XML comments. More...
 
bool openTagImpl (const word &tagName)
 
 formatter (std::ostream &os)
 Construct and attach to an output stream. More...
 

Additional Inherited Members

- Public Types inherited from formatter
enum  quoteChar : char { DOUBLE_QUOTE = '\"' , SINGLE_QUOTE = '\'' }
 Quoting for XML attributes. More...
 
typedef uint64_t headerType
 The header data is vtk UInt64. More...
 
- Static Public Attributes inherited from formatter
static constexpr uint64_t npos = uint64_t(-1)
 Out of range position or size. More...
 
- Protected Attributes inherited from formatter
std::ostream & os_
 The output stream for the formatter. More...
 
DynamicList< wordxmlTags_
 LIFO stack of current XML tags. More...
 
bool inTag_
 Tag open/closed/ended state. More...
 
char quote_
 Quoting character for XML attributes. More...
 

Detailed Description

Appended raw binary output.

Source files

Definition at line 52 of file foamVtkAppendRawFormatter.H.

Constructor & Destructor Documentation

◆ appendRawFormatter() [1/2]

appendRawFormatter ( const appendRawFormatter )
protecteddelete

No copy construct.

◆ appendRawFormatter() [2/2]

appendRawFormatter ( std::ostream &  os)
explicit

Construct and attach to an output stream.

Definition at line 55 of file foamVtkAppendRawFormatter.C.

◆ ~appendRawFormatter()

virtual ~appendRawFormatter ( )
virtualdefault

Destructor.

Member Function Documentation

◆ write() [1/5]

void write ( const char *  s,
std::streamsize  n 
)
protected

Write.

Definition at line 43 of file foamVtkAppendRawFormatter.C.

References n, formatter::os(), and s().

Here is the call graph for this function:

◆ operator=()

void operator= ( const appendRawFormatter )
protecteddelete

No copy assignment.

◆ opts()

const Foam::vtk::outputOptions & opts ( ) const
virtual

The output is APPEND_BINARY.

Implements formatter.

Definition at line 65 of file foamVtkAppendRawFormatter.C.

◆ name()

const char * name ( ) const
virtual

Output name for XML type ("append")

Implements formatter.

Definition at line 71 of file foamVtkAppendRawFormatter.C.

◆ encoding()

const char * encoding ( ) const
virtual

Output name for append encoding type ("raw")

Implements formatter.

Definition at line 77 of file foamVtkAppendRawFormatter.C.

◆ offset()

uint64_t offset ( const uint64_t  numbytes)
virtual

Increase the append data offset by numbytes and sizeof(uint64_t).

The additional (uint64_t) size information is consistent with writeSize()

Returns
The previous data offset

Reimplemented from formatter.

Definition at line 83 of file foamVtkAppendRawFormatter.C.

References formatter::npos.

◆ writeSize()

bool writeSize ( const uint64_t  numbytes)
virtual

Write leading size for binary output.

Returns
True - format uses this information

Implements formatter.

Definition at line 95 of file foamVtkAppendRawFormatter.C.

References write().

Here is the call graph for this function:

◆ write() [2/5]

void write ( const uint8_t  val)
virtual

Implements formatter.

Definition at line 102 of file foamVtkAppendRawFormatter.C.

References write().

Here is the call graph for this function:

◆ write() [3/5]

void write ( const label  val)
virtual

Implements formatter.

Definition at line 108 of file foamVtkAppendRawFormatter.C.

References write().

Here is the call graph for this function:

◆ write() [4/5]

void write ( const float  val)
virtual

Implements formatter.

Definition at line 115 of file foamVtkAppendRawFormatter.C.

References write().

Here is the call graph for this function:

◆ write() [5/5]

void write ( const double  val)
virtual

Implements formatter.

Definition at line 122 of file foamVtkAppendRawFormatter.C.

References write().

Here is the call graph for this function:

◆ flush()

void flush ( )
virtual

A no-op for this format.

Implements formatter.

Definition at line 143 of file foamVtkAppendRawFormatter.C.


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