Classes | Public Member Functions | List of all members
OFstreamCollator Class Reference

Threaded file writer. More...

Public Member Functions

 TypeName ("OFstreamCollator")
 
 OFstreamCollator (const off_t maxBufferSize)
 Construct from buffer size. 0 = do not use thread. More...
 
virtual ~OFstreamCollator ()
 Destructor. More...
 
bool write (const word &typeName, const fileName &, const string &data, IOstream::streamFormat, IOstream::versionNumber, IOstream::compressionType, const bool append)
 Write file with contents. Blocks until writethread has space. More...
 

Detailed Description

Threaded file writer.

Source files

Definition at line 50 of file OFstreamCollator.H.

Constructor & Destructor Documentation

◆ OFstreamCollator()

OFstreamCollator ( const off_t  maxBufferSize)

Construct from buffer size. 0 = do not use thread.

Definition at line 192 of file OFstreamCollator.C.

◆ ~OFstreamCollator()

~OFstreamCollator ( )
virtual

Destructor.

Definition at line 222 of file OFstreamCollator.C.

References Foam::endl(), UPstream::freeCommunicator(), Foam::freeMutex(), Foam::freeThread(), Foam::joinThread(), Foam::Pout, and OFstreamCollator::write().

Here is the call graph for this function:

Member Function Documentation

◆ TypeName()

TypeName ( "OFstreamCollator"  )

◆ write()

bool write ( const word typeName,
const fileName fName,
const string data,
IOstream::streamFormat  fmt,
IOstream::versionNumber  ver,
IOstream::compressionType  cmp,
const bool  append 
)

Write file with contents. Blocks until writethread has space.

available (total file sizes < maxBufferSize)

Definition at line 252 of file OFstreamCollator.C.

References Foam::createThread(), Foam::endl(), forAllConstIter(), Foam::lockMutex(), Foam::Pout, FIFOStack< T >::push(), Foam::sleep(), Foam::unlockMutex(), and writeData().

Referenced by OFstreamCollator::~OFstreamCollator(), and threadedCollatedOFstream::~threadedCollatedOFstream().

Here is the call graph for this function:
Here is the caller graph for this function:

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