FreeFOAM The Cross-Platform CFD Toolkit
prefixOSstream Class Reference

Version of OSstream which prints a prefix on each line. More...

#include <OpenFOAM/prefixOSstream.H>


Detailed Description

Version of OSstream which prints a prefix on each line.

This is useful for running in parallel as it allows the processor number to be automatically prepended to each message line.

Source files

Definition at line 52 of file prefixOSstream.H.

+ Inheritance diagram for prefixOSstream:
+ Collaboration diagram for prefixOSstream:

List of all members.

Public Member Functions

 prefixOSstream (ostream &os, const string &name, streamFormat format=ASCII, versionNumber version=currentVersion, compressionType compression=UNCOMPRESSED)
 Set stream status.
const stringprefix () const
 Return the prefix of the stream.
stringprefix ()
 Return non-const access to the prefix of the stream.
virtual Ostreamwrite (const token &)
 Write next token to stream.
virtual Ostreamwrite (const char)
 Write character.
virtual Ostreamwrite (const char *)
 Write character string.
virtual Ostreamwrite (const word &)
 Write word.
virtual Ostreamwrite (const string &)
 Write string.
virtual OstreamwriteQuoted (const std::string &, const bool quoted=true)
 Write std::string surrounded by quotes.
virtual Ostreamwrite (const label)
 Write label.
virtual Ostreamwrite (const floatScalar)
 Write floatScalar.
virtual Ostreamwrite (const doubleScalar)
 Write doubleScalar.
virtual Ostreamwrite (const char *, std::streamsize)
 Write binary block.
virtual void indent ()
 Add indentation characters.
virtual void print (Ostream &) const
 Print description of IOstream to Ostream.
- Public Member Functions inherited from OSstream
 OSstream (ostream &os, const string &name, streamFormat format=ASCII, versionNumber version=currentVersion, compressionType compression=UNCOMPRESSED)
 Set stream status.
virtual const fileNamename () const
 Return the name of the stream.
virtual fileNamename ()
 Return non-const access to the name of the stream.
virtual ios_base::fmtflags flags () const
 Return flags of output stream.
virtual ios_base::fmtflags flags (const ios_base::fmtflags flags)
 Set flags of output stream.
virtual void flush ()
 Flush stream.
virtual void endl ()
 Add newline and flush stream.
virtual int width () const
 Get width of output field.
virtual int width (const int)
 Set width of output field (and return old width)
virtual int precision () const
 Get precision of output field.
virtual int precision (const int)
 Set precision of output field (and return old precision)
- Public Member Functions inherited from Ostream
 Ostream (streamFormat format=ASCII, versionNumber version=currentVersion, compressionType compression=UNCOMPRESSED)
 Set stream status.
virtual ~Ostream ()
 Destructor.
virtual Ostreamwrite (const keyType &)
 Write keyType.
unsigned short indentLevel () const
 Return indent level.
unsigned short & indentLevel ()
 Access to indent level.
void incrIndent ()
 Incrememt the indent level.
void decrIndent ()
 Decrememt the indent level.
OstreamwriteKeyword (const keyType &)
 Write the keyword followed by an appropriate indentation.
Ostreamoperator() () const
 Return a non-const reference to const Ostream.
- Public Member Functions inherited from IOstream
 IOstream (streamFormat format, versionNumber version, compressionType compression=UNCOMPRESSED)
 Construct setting format and version.
virtual ~IOstream ()
virtual bool check (const char *operation) const
 Check IOstream status for given operation.
void fatalCheck (const char *operation) const
 Check IOstream status for given operation.
bool opened () const
 Return true if stream has been opened.
bool closed () const
 Return true if stream is closed.
bool good () const
 Return true if next operation might succeed.
bool eof () const
 Return true if end of input seen.
bool fail () const
 Return true if next operation will fail.
bool bad () const
 Return true if stream is corrupted.
 operator void * () const
 Return non-zero if the stream has not failed.
bool operator! () const
 Return true if the stream has failed.
streamFormat format () const
 Return current stream format.
streamFormat format (const streamFormat fmt)
 Set the stream format.
streamFormat format (const word &fmt)
 Set the stream format from word.
versionNumber version () const
 Return the stream version.
versionNumber version (const versionNumber ver)
 Set the stream version.
compressionType compression () const
 Return the stream compression.
compressionType compression (const compressionType cmp)
 Set the stream compression.
compressionType compression (const word &cmp)
 Set the stream compression from word.
label lineNumber () const
 Return current stream line number.
label & lineNumber ()
 Return current stream line number.
label lineNumber (const label ln)
 Set the stream line number.
void setEof ()
 Set stream to have reached eof.
void setFail ()
 Set stream to have failed.
void setBad ()
 Set stream to be bad.
virtual ios::fmtflags flags (const ios::fmtflags f)=0
 Set flags of stream.
ios::fmtflags setf (const ios::fmtflags f)
 Set flags of stream.
ios::fmtflags setf (const ios::fmtflags f, const ios::fmtflags mask)
 Set flags of given field of stream.
void unsetf (const ios::fmtflags uf)
 Unset flags of stream.
void print (Ostream &, const int streamState) const
 Check given stream state bits.
InfoProxy< IOstreaminfo () const
 Return info proxy.

Additional Inherited Members

- Protected Member Functions inherited from OSstream
ostream & stream ()
 Return the stream reference.
const ostream & stream () const
 Return the const stream reference.

Constructor & Destructor Documentation

prefixOSstream ( ostream &  os,
const string name,
streamFormat  format = ASCII,
versionNumber  version = currentVersion,
compressionType  compression = UNCOMPRESSED 
)

Set stream status.

Definition at line 45 of file prefixOSstream.C.


Member Function Documentation

const string& prefix ( ) const
inline

Return the prefix of the stream.

Definition at line 87 of file prefixOSstream.H.

Referenced by indexedOctree< Type >::print(), and PstreamImpl::setParRun().

string& prefix ( )
inline

Return non-const access to the prefix of the stream.

Definition at line 93 of file prefixOSstream.H.

Foam::Ostream & write ( const token )
virtual

Write next token to stream.

Reimplemented from OSstream.

Definition at line 68 of file prefixOSstream.C.

Referenced by treeNode< Type >::distribute().

Foam::Ostream & write ( const char  c)
virtual

Write character.

Reimplemented from OSstream.

Definition at line 74 of file prefixOSstream.C.

References token::NL, and OSstream::write().

Foam::Ostream & write ( const char *  str)
virtual

Write character string.

Reimplemented from OSstream.

Definition at line 88 of file prefixOSstream.C.

References token::NL, and OSstream::write().

Foam::Ostream & write ( const word val)
virtual

Write word.

Reimplemented from OSstream.

Definition at line 103 of file prefixOSstream.C.

References OSstream::write().

Foam::Ostream & write ( const string val)
virtual

Write string.

Reimplemented from OSstream.

Definition at line 110 of file prefixOSstream.C.

References OSstream::write().

Foam::Ostream & writeQuoted ( const std::string &  val,
const bool  quoted = true 
)
virtual

Write std::string surrounded by quotes.

Optional write without quotes.

Reimplemented from OSstream.

Definition at line 118 of file prefixOSstream.C.

References OSstream::writeQuoted().

Foam::Ostream & write ( const label  val)
virtual

Write label.

Reimplemented from OSstream.

Definition at line 128 of file prefixOSstream.C.

References OSstream::write().

Foam::Ostream & write ( const floatScalar  val)
virtual

Write floatScalar.

Reimplemented from OSstream.

Definition at line 135 of file prefixOSstream.C.

References OSstream::write().

Foam::Ostream & write ( const doubleScalar  val)
virtual

Write doubleScalar.

Reimplemented from OSstream.

Definition at line 142 of file prefixOSstream.C.

References OSstream::write().

Foam::Ostream & write ( const char *  buf,
std::streamsize  count 
)
virtual

Write binary block.

Reimplemented from OSstream.

Definition at line 150 of file prefixOSstream.C.

References OSstream::write().

void indent ( )
virtual

Add indentation characters.

Reimplemented from OSstream.

Definition at line 160 of file prefixOSstream.C.

References OSstream::indent().

void print ( Ostream os) const
virtual

Print description of IOstream to Ostream.

Reimplemented from OSstream.

Definition at line 61 of file prefixOSstream.C.

References OSstream::print().


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