lcls2
C++ API: public headers of xtcdata, psalg, psdaq and psana
Loading...
Searching...
No Matches
Drp::FileWriterBase Class Referenceabstract

Abstract file writer interface (open, close, writeEvent) with a writing counter that the implementations in FileWriter.cc raise while a write() call is in progress. More...

#include <FileWriterBase.hh>

Inherited by Drp::BufferedFileWriter, Drp::BufferedFileWriterMT, Drp::BufferedMultiFileWriterMT, Drp::Gpu::FileWriter, and Drp::SmdWriterBase.

Public Member Functions

 FileWriterBase ()
 Start with the writing counter at 0.
 
virtual ~FileWriterBase ()
 Does nothing; empty body.
 
virtual int open (const std::string &fileName)=0
 Pure virtual: open fileName for writing; the implementations in FileWriter.cc return 0 on success.
 
virtual int close ()=0
 Pure virtual: flush buffered data and close the current file.
 
virtual void writeEvent (const void *data, size_t size, XtcData::TimeStamp ts)=0
 Pure virtual: write size bytes from data; the implementations use the seconds of ts to age their batches.
 
virtual uint64_t writing () const
 Return the writing counter (non-zero while an implementation is inside a write).
 

Protected Attributes

volatile uint64_t m_writing
 

Detailed Description

Abstract file writer interface (open, close, writeEvent) with a writing counter that the implementations in FileWriter.cc raise while a write() call is in progress.

Constructor & Destructor Documentation

◆ FileWriterBase()

Drp::FileWriterBase::FileWriterBase ( )
inline

Start with the writing counter at 0.

◆ ~FileWriterBase()

virtual Drp::FileWriterBase::~FileWriterBase ( )
inlinevirtual

Does nothing; empty body.

Member Function Documentation

◆ close()

virtual int Drp::FileWriterBase::close ( )
pure virtual

Pure virtual: flush buffered data and close the current file.

Implemented in Drp::BufferedFileWriter, Drp::BufferedFileWriterMT, Drp::BufferedMultiFileWriterMT, Drp::SmdWriter, and Drp::Gpu::FileWriter.

◆ open()

virtual int Drp::FileWriterBase::open ( const std::string &  fileName)
pure virtual

Pure virtual: open fileName for writing; the implementations in FileWriter.cc return 0 on success.

Implemented in Drp::BufferedFileWriter, Drp::BufferedFileWriterMT, Drp::BufferedMultiFileWriterMT, Drp::SmdWriter, and Drp::Gpu::FileWriter.

◆ writeEvent()

virtual void Drp::FileWriterBase::writeEvent ( const void *  data,
size_t  size,
XtcData::TimeStamp  ts 
)
pure virtual

Pure virtual: write size bytes from data; the implementations use the seconds of ts to age their batches.

Implemented in Drp::BufferedFileWriter, Drp::BufferedFileWriterMT, Drp::BufferedMultiFileWriterMT, Drp::SmdWriter, Drp::Gpu::FileWriter, and Drp::Gpu::FileWriterAsync.

◆ writing()

virtual uint64_t Drp::FileWriterBase::writing ( ) const
inlinevirtual

Return the writing counter (non-zero while an implementation is inside a write).

Reimplemented in Drp::BufferedMultiFileWriterMT.

Member Data Documentation

◆ m_writing

volatile uint64_t Drp::FileWriterBase::m_writing
protected

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