FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

Output inter-processor communications stream. More...

#include <OpenFOAM/OPstream.H>


Detailed Description

Output inter-processor communications stream.

Source files

Definition at line 53 of file OPstream.H.

Inheritance diagram for OPstream:
Collaboration diagram for OPstream:

List of all members.

Public Member Functions

 OPstream (const commsTypes commsType, const int toProcNo, const label bufSize=0, streamFormat format=BINARY, versionNumber version=currentVersion)
 Construct given process index to send to and optional buffer size,.
 ~OPstream ()
ios_base::fmtflags  flags () const
 Return flags of output stream.
Ostream &  write (const token &)
 Write next token to stream.
Ostream &  write (const char)
 Write character.
Ostream &  write (const char *)
 Write character string.
Ostream &  write (const word &)
 Write word.
Ostream &  write (const string &)
 Write string.
Ostream &  writeQuoted (const std::string &, const bool quoted=true)
 Write std::string surrounded by quotes.
Ostream &  write (const label)
 Write label.
Ostream &  write (const floatScalar)
 Write floatScalar.
Ostream &  write (const doubleScalar)
 Write doubleScalar.
Ostream &  write (const char *, std::streamsize)
 Write binary block.
void  indent ()
 Add indentation characters.
void  flush ()
 Flush stream.
void  endl ()
 Add newline and flush stream.
int  width () const
 Get width of output field.
int  width (const int)
 Set width of output field (and return old width)
int  precision () const
 Get precision of output field.
int  precision (const int)
 Set precision of output field (and return old precision)
ios_base::fmtflags  flags (const ios_base::fmtflags)
 Set flags of stream.
void  print (Ostream &) const
 Print description of IOstream to Ostream.

Static Public Member Functions

static bool  write (const commsTypes commsType, const int toProcNo, const char *buf, const std::streamsize bufSize)
 Write given buffer to given processor.
static void  waitRequests ()
 Non-blocking writes: wait until all have finished.
static bool  finishedRequest (const label i)
 Non-blocking writes: has request i finished?

Protected Attributes

int  toProcNo_

Constructor & Destructor Documentation

OPstream ( const commsTypes   commsType,
const int   toProcNo,
const label   bufSize = 0,
streamFormat   format = BINARY,
versionNumber   version = currentVersion  
)

Construct given process index to send to and optional buffer size,.

write format and IO version

Definition at line 95 of file OPstream.C.

~OPstream (  )

Definition at line 118 of file OPstream.C.


Member Function Documentation

ios_base::fmtflags flags (  ) const [inline, virtual]

Return flags of output stream.

Implements IOstream.

Definition at line 118 of file OPstream.H.

static bool write ( const commsTypes   commsType,
const int   toProcNo,
const char *   buf,
const std::streamsize   bufSize  
) [inline, static]
static void waitRequests (  ) [inline, static]

Non-blocking writes: wait until all have finished.

Definition at line 139 of file OPstream.H.

Referenced by mapDistribute::compact(), and GeometricField< Type, PatchField, GeoMesh >::GeometricBoundaryField::evaluate().

static bool finishedRequest ( const label   i  ) [inline, static]

Non-blocking writes: has request i finished?

Definition at line 145 of file OPstream.H.

Foam::Ostream & write ( const token &    ) [virtual]

Write next token to stream.

Implements Ostream.

Definition at line 125 of file OPstream.C.

References notImplemented.

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

Write character.

Implements Ostream.

Definition at line 133 of file OPstream.C.

References Foam::isspace().

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

Write character string.

Implements Ostream.

Definition at line 144 of file OPstream.C.

Foam::Ostream & write ( const word &   str  ) [virtual]

Write word.

Implements Ostream.

Definition at line 163 of file OPstream.C.

References token::WORD.

Foam::Ostream & write ( const string &   str  ) [virtual]

Write string.

Implements Ostream.

Definition at line 175 of file OPstream.C.

References token::STRING.

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

Write std::string surrounded by quotes.

Optional write without quotes.

Implements Ostream.

Definition at line 187 of file OPstream.C.

References token::STRING.

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

Write label.

Implements Ostream.

Definition at line 199 of file OPstream.C.

References token::LABEL.

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

Write floatScalar.

Implements Ostream.

Definition at line 207 of file OPstream.C.

References token::FLOAT_SCALAR.

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

Write doubleScalar.

Implements Ostream.

Definition at line 215 of file OPstream.C.

References token::DOUBLE_SCALAR.

Foam::Ostream & write ( const char *   data,
std::streamsize   count  
) [virtual]

Write binary block.

Implements Ostream.

Definition at line 223 of file OPstream.C.

References Foam::abort(), Foam::FatalError, FatalErrorIn, and format().

void indent (  ) [inline, virtual]

Add indentation characters.

Implements Ostream.

Definition at line 186 of file OPstream.H.

void flush (  ) [inline, virtual]

Flush stream.

Implements Ostream.

Definition at line 193 of file OPstream.H.

void endl (  ) [inline, virtual]

Add newline and flush stream.

Implements Ostream.

Definition at line 197 of file OPstream.H.

int width (  ) const [inline, virtual]

Get width of output field.

Implements Ostream.

Definition at line 201 of file OPstream.H.

int width ( const   int  ) [inline, virtual]

Set width of output field (and return old width)

Implements Ostream.

Definition at line 207 of file OPstream.H.

int precision (  ) const [inline, virtual]

Get precision of output field.

Implements Ostream.

Definition at line 213 of file OPstream.H.

int precision ( const   int  ) [inline, virtual]

Set precision of output field (and return old precision)

Implements Ostream.

Definition at line 219 of file OPstream.H.

ios_base::fmtflags flags ( const ios_base::fmtflags    ) [inline]

Set flags of stream.

Definition at line 228 of file OPstream.H.

void print ( Ostream &   os  ) const [virtual]

Print description of IOstream to Ostream.

Reimplemented from IOstream.

Definition at line 41 of file PstreamsPrint.C.

References Foam::endl().


Member Data Documentation

int toProcNo_ [protected]

Definition at line 88 of file OPstream.H.


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