ATLAS Offline Software
|
This class defines abstract interface for data writing. More...
#include <ByteStreamDataWriter.h>
Public Member Functions | |
ByteStreamDataWriter () | |
virtual | ~ByteStreamDataWriter () |
ByteStreamDataWriter (const ByteStreamDataWriter &)=delete | |
ByteStreamDataWriter & | operator= (const ByteStreamDataWriter &)=delete |
virtual EventStorage::DWError | putData (unsigned int dataSize, const void *data)=0 |
Write a single block of data. More... | |
virtual bool | good () const =0 |
Feedback to user, check if open and last write went OK. More... | |
Static Public Member Functions | |
static std::unique_ptr< ByteStreamDataWriter > | makeWriter (int version, const std::string &writingPath, const std::string &fileNameCore, const EventStorage::run_parameters_record &rPar, const std::vector< std::string > &fmdStrings, unsigned int maxFileNE=0, unsigned int maxFileMB=0, unsigned int startIndex=1, EventStorage::CompressionType compression=EventStorage::NONE, unsigned int compLevel=1) |
Factory method returning data writer instance for specified version. More... | |
static std::unique_ptr< ByteStreamDataWriter > | makeWriter (int version, const std::string &writingPath, boost::shared_ptr< EventStorage::FileNameCallback > theFNCB, const EventStorage::run_parameters_record &rPar, const std::string &project, const std::string &streamType, const std::string &streamName, const std::string &stream, unsigned int lumiBlockNumber, const std::string &applicationName, const std::vector< std::string > &fmdStrings, unsigned int maxFileNE=0, unsigned int maxFileMB=0, EventStorage::CompressionType compression=EventStorage::NONE, unsigned int compLevel=1) |
Factory method returning data writer instance for specified version. More... | |
static std::unique_ptr< ByteStreamDataWriter > | makeWriter (const DataWriterParameters ¶meters) |
Factory method returning data writer instance for specified version. More... | |
This class defines abstract interface for data writing.
Main purpose of this class is to provide interface for writing different versions of output ByteStream files. This interface will be implemented on top of the EventStorage/DataWriter (from tdaq-common) and it will only provide few methods relevant to this package. The interface is defined in terms of data structures of the current version of the EventStorage, implementations for older versions will need to translate those structures into their version-specific data.
In addition to abstract methods this class defines few factory methods which return instances implementing this interface.
Definition at line 41 of file ByteStreamDataWriter.h.
|
inline |
Definition at line 123 of file ByteStreamDataWriter.h.
|
inlinevirtual |
Definition at line 124 of file ByteStreamDataWriter.h.
|
delete |
|
pure virtual |
Feedback to user, check if open and last write went OK.
Implemented in ByteStreamDataWriterV5.
|
static |
Factory method returning data writer instance for specified version.
Throws exception in case of problems, never returns zero pointer.
parameters | set of parameters needed to initiate DataWriter |
std::exception | (or sub-class) is thrown in case of problems. |
Definition at line 170 of file ByteStreamDataWriter.cxx.
|
static |
Factory method returning data writer instance for specified version.
Throws exception in case of problems, never returns zero pointer.
version | writer version to instantiate, 0 for most current version, other supported values: 5 for run1-compatible output. Exception is thrown is version is not supported. |
writingPath | directory where to write data |
theFNCB | callback method for generating file names |
rPar | other parameters from IS including the run number |
fmdStrings | optional vector of strings containing metadata |
maxFileNE | max size of a file in number of data blocks (or events) |
maxFileMB | max size of a file in MB. The file is closed before this limit is overrun. |
startIndex | initial file sequence index |
compression | Compression type |
compLevel | Compression level |
std::exception | (or sub-class) is thrown in case of problems. |
Definition at line 112 of file ByteStreamDataWriter.cxx.
|
static |
Factory method returning data writer instance for specified version.
Throws exception in case of problems, never returns zero pointer.
version | writer version to instantiate, 0 for most current version, other supported values: 5 for run1-compatible output. Exception is thrown if version is not supported. |
writingPath | directory where to write data |
fileNameCore | file name not including the ending "._NNNN.data" |
rPar | other parameters from IS including the run number |
fmdStrings | optional vector of strings containing metadata |
maxFileNE | max size of a file in number of data blocks (or events) |
maxFileMB | max size of a file in MB. The file is closed before this limit is overrun. |
startIndex | initial file sequence index |
compression | Compression type |
compLevel | Compression level |
std::exception | (or sub-class) is thrown in case of problems. |
Definition at line 69 of file ByteStreamDataWriter.cxx.
|
delete |
|
pure virtual |
Write a single block of data.
If one of the size limits would be exceeded, the current file will be closed and another one will be opened automatically.
dataSize | size of the data block in bytes |
data | start of the event data in memory |
Implemented in ByteStreamDataWriterV5.