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... | |
OFstreamCollator | ( | const off_t | maxBufferSize | ) |
Construct from buffer size. 0 = do not use thread.
Definition at line 192 of file OFstreamCollator.C.
|
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().
TypeName | ( | "OFstreamCollator" | ) |
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().