LCIO  02.17
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
IO::LCWriter Class Referenceabstract

Interface for writing data with LCIO. More...

#include <LCWriter.h>

+ Inheritance diagram for IO::LCWriter:

Public Member Functions

virtual ~LCWriter ()
 Destructor. More...
 
virtual void open (const std::string &filename)=0
 Opens a file for writing. More...
 
virtual void open (const std::string &filename, int writeMode)=0
 Opens a file for writing. More...
 
virtual void setCompressionLevel (int level)=0
 Set the compression level - needs to be called before open() otherwise call will have no effect. More...
 
virtual void writeRunHeader (const EVENT::LCRunHeader *hdr)=0
 Writes the given run header to file. More...
 
virtual void writeEvent (const EVENT::LCEvent *evt)=0
 Writes the given event to file. More...
 
virtual void close ()=0
 Closes the output file/stream. More...
 
virtual void flush ()=0
 Flushes the output file/stream. More...
 

Detailed Description

Interface for writing data with LCIO.

Uses interfaces from EVENT/hep.lcio.event. Use LCFactory to instantiate a corresponding LCWriter object for the output format at hand (SIO only, so far).

See Also
LCFactory
Author
gaede
Version
Mar 4, 2003

Definition at line 27 of file LCWriter.h.

Constructor & Destructor Documentation

virtual IO::LCWriter::~LCWriter ( )
inlinevirtual

Destructor.

Definition at line 31 of file LCWriter.h.

Member Function Documentation

virtual void IO::LCWriter::close ( )
pure virtual

Closes the output file/stream.

Exceptions
IOException

Implemented in UTIL::LCSplitWriter, and SIO::SIOWriter.

virtual void IO::LCWriter::flush ( )
pure virtual

Flushes the output file/stream.

Exceptions
IOException

Implemented in UTIL::LCSplitWriter, and SIO::SIOWriter.

virtual void IO::LCWriter::open ( const std::string filename)
pure virtual

Opens a file for writing.

If file with given name exists, an exception is thrown. Use append or new mode instead.

Exceptions
IOException

Implemented in UTIL::LCSplitWriter, and SIO::SIOWriter.

virtual void IO::LCWriter::open ( const std::string filename,
int  writeMode 
)
pure virtual

Opens a file for writing.

Possible write modes are: LCIO::WRITE_NEW (existing files are replaced) and LCIO::WRITE_APPEND.

Exceptions
IOException

Implemented in UTIL::LCSplitWriter, and SIO::SIOWriter.

virtual void IO::LCWriter::setCompressionLevel ( int  level)
pure virtual

Set the compression level - needs to be called before open() otherwise call will have no effect.

If not called the Writer will use default compression.
Valid compression levels are:

  • level < 0 : default compression
  • level == 0 : no compression
  • level > 0 : compression level (typically 1 (fastest) - 9 (best compression))

Status: (v01-09)
C++: experimental code - don't use for production
Java: not implemented

Parameters
levelcompression level

Implemented in UTIL::LCSplitWriter, and SIO::SIOWriter.

Referenced by UTIL::LCSplitWriter::setCompressionLevel().

virtual void IO::LCWriter::writeEvent ( const EVENT::LCEvent evt)
pure virtual

Writes the given event to file.

Exceptions
IOException

Implemented in UTIL::LCSplitWriter, and SIO::SIOWriter.

virtual void IO::LCWriter::writeRunHeader ( const EVENT::LCRunHeader hdr)
pure virtual

Writes the given run header to file.

Exceptions
IOException

Implemented in SIO::SIOWriter, and UTIL::LCSplitWriter.


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