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

Small-data writer that forwards open, close and writeEvent to an internal BufferedFileWriter. More...

#include <FileWriter.hh>

Inherits Drp::SmdWriterBase.

Public Member Functions

 SmdWriter (size_t bufferSize, size_t maxTrSize)
 Create the scratch buffer of maxTrSize bytes and an internal BufferedFileWriter with bufferSize bytes.
 
 ~SmdWriter () override
 Does nothing; empty body.
 
int open (const std::string &fileName) override
 Open fileName with the internal BufferedFileWriter and return its result.
 
int close () override
 Close the internal BufferedFileWriter and return its result.
 
void writeEvent (const void *data, size_t size, XtcData::TimeStamp ts) override
 Pass the event to the internal BufferedFileWriter.
 
- Public Member Functions inherited from Drp::SmdWriterBase
 SmdWriterBase (size_t maxTrSize)
 Allocate buffer with maxTrSize bytes.
 
virtual ~SmdWriterBase ()
 Does nothing; empty body.
 
void addNames (XtcData::Xtc &parent, const void *bufEnd, unsigned nodeId)
 Declared here, but no definition is compiled: FileWriterBase.cc defines SmdWriter::addNames() with this signature and is not listed in drp/CMakeLists.txt.
 
- Public Member Functions inherited from Drp::FileWriterBase
 FileWriterBase ()
 Start with the writing counter at 0.
 
virtual ~FileWriterBase ()
 Does nothing; empty body.
 
virtual uint64_t writing () const
 Return the writing counter (non-zero while an implementation is inside a write).
 

Additional Inherited Members

- Public Attributes inherited from Drp::SmdWriterBase
std::vector< uint8_t > buffer
 Scratch buffer of maxTrSize bytes, sized by the constructor.
 
XtcData::NamesLookup namesLookup
 Names lookup table for the small-data datagrams.
 
- Protected Attributes inherited from Drp::FileWriterBase
volatile uint64_t m_writing
 

Detailed Description

Small-data writer that forwards open, close and writeEvent to an internal BufferedFileWriter.

Constructor & Destructor Documentation

◆ SmdWriter()

Drp::SmdWriter::SmdWriter ( size_t  bufferSize,
size_t  maxTrSize 
)

Create the scratch buffer of maxTrSize bytes and an internal BufferedFileWriter with bufferSize bytes.

◆ ~SmdWriter()

Drp::SmdWriter::~SmdWriter ( )
inlineoverride

Does nothing; empty body.

Member Function Documentation

◆ close()

int Drp::SmdWriter::close ( )
inlineoverridevirtual

Close the internal BufferedFileWriter and return its result.

Implements Drp::FileWriterBase.

◆ open()

int Drp::SmdWriter::open ( const std::string &  fileName)
inlineoverridevirtual

Open fileName with the internal BufferedFileWriter and return its result.

Implements Drp::FileWriterBase.

◆ writeEvent()

void Drp::SmdWriter::writeEvent ( const void *  data,
size_t  size,
XtcData::TimeStamp  ts 
)
inlineoverridevirtual

Pass the event to the internal BufferedFileWriter.

Implements Drp::FileWriterBase.


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