DABC (Data Acquisition Backbone Core)  2.9.9
Public Member Functions | Protected Member Functions | Protected Attributes

Interface for implementing file outputs. More...

#include <dabc/DataIO.h>

Inheritance diagram for dabc::FileOutput:
dabc::DataOutput dabc::BinaryFileOutput hadaq::HldOutput mbs::LmdOutput

Public Member Functions

virtual std::string ProvideInfo ()
 Method can be used to get debug info about output. More...
 
void SetIO (dabc::FileInterface *io)
 
virtual bool Write_Init ()
 This is generic virtual method to initialize output before real work is started. More...
 
virtual bool Write_Stat (dabc::Command cmd)
 Fill different statistic parameters into provided command. More...
 
virtual ~FileOutput ()
 
- Public Member Functions inherited from dabc::DataOutput
void SetInfoParName (const std::string &name)
 Methods set parameter name, which could be used for debug output. More...
 
virtual unsigned Write_Buffer (Buffer &buf)
 Start writing of buffer to output. More...
 
virtual unsigned Write_Check ()
 Check if output can be done. More...
 
virtual unsigned Write_Complete ()
 Complete writing of the buffer. More...
 
virtual void Write_Flush ()
 Flush output object, called when buffer with EOL type is appeared. More...
 
virtual bool Write_Restart (dabc::Command cmd)
 Method used to restart output - like recreate new output file. More...
 
virtual bool Write_Retry ()
 Returns true if output object can be reinitialized for recover error. More...
 
virtual double Write_Timeout ()
 Timeout in seconds for write operation. More...
 
bool WriteBuffer (Buffer &buf)
 Write buffer to the output. More...
 
virtual ~DataOutput ()
 

Protected Member Functions

void AccountBuffer (unsigned sz, int numev=0)
 
bool CheckBufferForNextFile (unsigned sz)
 Return true if new file should be started. More...
 
const std::string & CurrentFileName () const
 
 FileOutput (const dabc::Url &url, const std::string &ext="")
 
int GetSizeLimitMB () const
 
std::string ProduceFileName (const std::string &suffix)
 
void ProduceNewFileName ()
 
- Protected Member Functions inherited from dabc::DataOutput
 DataOutput (const dabc::Url &url)
 
void ShowInfo (int lvl, const std::string &info)
 
virtual WorkerAddonWrite_GetAddon ()
 Returns addon, provided by data output If specified, supposed that I/O object is double-derived from DataOutput and Addon. More...
 

Protected Attributes

std::string fCurrentFileName
 
int fCurrentFileNumber
 
long fCurrentFileSize
 
std::string fFileExtens
 
std::string fFileName
 
dabc::FileInterfacefIO
 
int fSizeLimitMB
 
long fTotalFileSize
 
long fTotalNumBufs
 
long fTotalNumEvents
 
- Protected Attributes inherited from dabc::DataOutput
std::string fInfoName
 

Detailed Description

Interface for implementing file outputs.

Provide convenient way for managing automatic file numbering.

Definition at line 283 of file DataIO.h.

Constructor & Destructor Documentation

◆ FileOutput()

dabc::FileOutput::FileOutput ( const dabc::Url url,
const std::string &  ext = "" 
)
protected

Definition at line 177 of file DataIO.cxx.

◆ ~FileOutput()

dabc::FileOutput::~FileOutput ( )
virtual

Definition at line 192 of file DataIO.cxx.

Member Function Documentation

◆ ProduceNewFileName()

void dabc::FileOutput::ProduceNewFileName ( )
protected

Definition at line 270 of file DataIO.cxx.

◆ CurrentFileName()

const std::string& dabc::FileOutput::CurrentFileName ( ) const
inlineprotected

Definition at line 301 of file DataIO.h.

◆ CheckBufferForNextFile()

bool dabc::FileOutput::CheckBufferForNextFile ( unsigned  sz)
protected

Return true if new file should be started.

Definition at line 277 of file DataIO.cxx.

◆ AccountBuffer()

void dabc::FileOutput::AccountBuffer ( unsigned  sz,
int  numev = 0 
)
protected

Definition at line 286 of file DataIO.cxx.

◆ ProduceFileName()

std::string dabc::FileOutput::ProduceFileName ( const std::string &  suffix)
protected

Definition at line 252 of file DataIO.cxx.

◆ GetSizeLimitMB()

int dabc::FileOutput::GetSizeLimitMB ( ) const
inlineprotected

Definition at line 312 of file DataIO.h.

◆ SetIO()

void dabc::FileOutput::SetIO ( dabc::FileInterface io)

Definition at line 200 of file DataIO.cxx.

◆ ProvideInfo()

std::string dabc::FileOutput::ProvideInfo ( )
virtual

Method can be used to get debug info about output.

Reimplemented from dabc::DataOutput.

Definition at line 295 of file DataIO.cxx.

◆ Write_Init()

bool dabc::FileOutput::Write_Init ( )
virtual

This is generic virtual method to initialize output before real work is started.

If returns false, object is immediately deleted

Reimplemented from dabc::DataOutput.

Reimplemented in mbs::LmdOutput, hadaq::HldOutput, and dabc::BinaryFileOutput.

Definition at line 211 of file DataIO.cxx.

◆ Write_Stat()

bool dabc::FileOutput::Write_Stat ( dabc::Command  cmd)
virtual

Fill different statistic parameters into provided command.

Reimplemented from dabc::DataOutput.

Reimplemented in hadaq::HldOutput.

Definition at line 322 of file DataIO.cxx.

Field Documentation

◆ fFileName

std::string dabc::FileOutput::fFileName
protected

Definition at line 286 of file DataIO.h.

◆ fSizeLimitMB

int dabc::FileOutput::fSizeLimitMB
protected

Definition at line 287 of file DataIO.h.

◆ fFileExtens

std::string dabc::FileOutput::fFileExtens
protected

Definition at line 288 of file DataIO.h.

◆ fIO

dabc::FileInterface* dabc::FileOutput::fIO
protected

Definition at line 290 of file DataIO.h.

◆ fCurrentFileNumber

int dabc::FileOutput::fCurrentFileNumber
protected

Definition at line 292 of file DataIO.h.

◆ fCurrentFileName

std::string dabc::FileOutput::fCurrentFileName
protected

Definition at line 293 of file DataIO.h.

◆ fCurrentFileSize

long dabc::FileOutput::fCurrentFileSize
protected

Definition at line 294 of file DataIO.h.

◆ fTotalFileSize

long dabc::FileOutput::fTotalFileSize
protected

Definition at line 296 of file DataIO.h.

◆ fTotalNumBufs

long dabc::FileOutput::fTotalNumBufs
protected

Definition at line 297 of file DataIO.h.

◆ fTotalNumEvents

long dabc::FileOutput::fTotalNumEvents
protected

Definition at line 298 of file DataIO.h.


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