evio  6.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
evio::FileCloser Class Reference

Class used to close files, each in its own thread, to avoid slowing down while file splitting. More...

#include <FileWritingSupport.h>

Public Member Functions

void close ()
 Stop & delete every thread that was started. More...
 
void removeThread (std::shared_ptr< CloseAsyncFChan > &thread)
 Remove thread from vector. More...
 
void closeAsyncFile (std::shared_ptr< std::fstream > &afc, std::shared_ptr< std::future< void >> &future1, std::shared_ptr< RecordSupply > &supply, std::shared_ptr< RecordRingItem > &ringItem, FileHeader &fileHeader, std::shared_ptr< std::vector< uint32_t >> &recordLengths, uint64_t bytesWritten, uint32_t recordNumber, bool addingTrailer, bool writeIndex, bool noFileWriting, ByteOrder &order)
 Close the given file, in the order received, in a separate thread. More...
 
 ~FileCloser ()
 

Detailed Description

Class used to close files, each in its own thread, to avoid slowing down while file splitting.

Unlike Java, C++ has no built-in thread pools so just create threads as needed.

Constructor & Destructor Documentation

◆ ~FileCloser()

evio::FileCloser::~FileCloser ( )
inline

References close().

Member Function Documentation

◆ close()

void evio::FileCloser::close ( )
inline

Stop & delete every thread that was started.

Referenced by ~FileCloser().

◆ closeAsyncFile()

void evio::FileCloser::closeAsyncFile ( std::shared_ptr< std::fstream > &  afc,
std::shared_ptr< std::future< void >> &  future1,
std::shared_ptr< RecordSupply > &  supply,
std::shared_ptr< RecordRingItem > &  ringItem,
FileHeader fileHeader,
std::shared_ptr< std::vector< uint32_t >> &  recordLengths,
uint64_t  bytesWritten,
uint32_t  recordNumber,
bool  addingTrailer,
bool  writeIndex,
bool  noFileWriting,
ByteOrder order 
)
inline

Close the given file, in the order received, in a separate thread.

Parameters
afcfile channel to close
future1
supply
ringItem
fileHeader
recordLengths
bytesWritten
recordNumber
addingTrailer
writeIndex
noFileWriting
order

◆ removeThread()

void evio::FileCloser::removeThread ( std::shared_ptr< CloseAsyncFChan > &  thread)
inline

Remove thread from vector.

Parameters
threadthread object to remove.

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