SIO::SIOWriter Class Reference

Concrete implementation of LCWriter using SIO. More...

#include <SIO/SIOWriter.h>

Inheritance diagram for SIO::SIOWriter:
IO::LCWriter

List of all members.

Public Member Functions

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

Protected Member Functions

void setUpHandlers (const EVENT::LCEvent *evt)
 Sets up the handlers for writing the current event.
void getSIOFileName (const std::string &filename, std::string &sioFilename)
 Creates a proper filename with extension 'slcio' in sioFilename.

Protected Attributes

SIO_stream * _stream
int _compressionLevel

Friends

class SIOReader
class SIOUnpack

Detailed Description

Concrete implementation of LCWriter using SIO.

Use LCFactory to instantiate.

See also:
LCFactory
Author:
gaede
Version:
Mar 6, 2003

Member Function Documentation

void SIO::SIOWriter::close (  )  [virtual]

Closes the output file/stream etc.

Exceptions:
IOException 

Implements IO::LCWriter.

void SIO::SIOWriter::flush (  )  [virtual]

Flushes the output file/stream etc.

Exceptions:
IOException 

Implements IO::LCWriter.

void SIO::SIOWriter::open ( const std::string &  filename,
int  writeMode 
) [virtual]

Opens a file for writing.

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

Exceptions:
IOException 

Implements IO::LCWriter.

References getSIOFileName(), SIO::LCSIO::getValidSIOName(), and SIO::LCSIO::seekStream().

void SIO::SIOWriter::open ( const std::string &  filename  )  [virtual]

Opens a file for writing.

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

Exceptions:
IOException 

Implements IO::LCWriter.

References getSIOFileName().

void SIO::SIOWriter::setCompressionLevel ( int  level  )  [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 : 1 (fastest) - 9 (best compression)

Experimental code - don't use for production.

Parameters:
level compression level

Implements IO::LCWriter.

void SIO::SIOWriter::setUpHandlers ( const EVENT::LCEvent evt  )  [protected]

Sets up the handlers for writing the current event.

Creates Handlers needed for writing the event on this stream.

Needs to be called for every event.

References EVENT::LCEvent::getCollection(), EVENT::LCEvent::getCollectionNames(), EVENT::LCCollection::getTypeName(), and EVENT::LCCollection::isTransient().

Referenced by writeEvent().

void SIO::SIOWriter::writeEvent ( const EVENT::LCEvent evt  )  [virtual]

Writes the given event to file.

Exceptions:
IOException 

Implements IO::LCWriter.

References EVENT::LCEvent::getEventNumber(), EVENT::LCEvent::getRunNumber(), and setUpHandlers().

void SIO::SIOWriter::writeRunHeader ( const EVENT::LCRunHeader hdr  )  [virtual]

Writes the given run header to file.

Exceptions:
IOException 

Implements IO::LCWriter.

References EVENT::LCRunHeader::getRunNumber().


The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Friends

Generated on 6 Mar 2020 for LCIO by  doxygen 1.6.1