LCIO  "2.7.4"
 All Classes Namespaces Functions Variables Typedefs Friends Pages
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
SIO::SIOWriter Class Reference

Concrete implementation of LCWriter using SIO. More...

#include <SIO/SIOWriter.h>

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

Public Member Functions

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

Protected Member Functions

void setUpHandlers (const EVENT::LCEvent *evt)
 Sets up the handlers for writing the current event. More...
 
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
 
LCIORandomAccessMgr _raMgr
 

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 ( )
throw (IO::IOException,
std::exception
)
virtual

Closes the output file/stream etc.

Exceptions
IOException

Implements IO::LCWriter.

References SIO::LCIORandomAccessMgr::clear(), and SIO::LCIORandomAccessMgr::writeRandomAccessRecords().

void SIO::SIOWriter::flush ( )
throw (IO::IOException,
std::exception
)
virtual

Flushes the output file/stream etc.

Exceptions
IOException

Implements IO::LCWriter.

void SIO::SIOWriter::open ( const std::string &  filename)
throw (IO::IOException,
std::exception
)
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.

void SIO::SIOWriter::open ( const std::string &  filename,
int  writeMode 
)
throw (IO::IOException,
std::exception
)
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 SIO::LCSIO::getValidSIOName(), and SIO::LCSIO::seekStream().

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
levelcompression 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().

void SIO::SIOWriter::writeEvent ( const EVENT::LCEvent evt)
throw (IO::IOException,
std::exception
)
virtual

Writes the given event to file.

Exceptions
IOException

Implements IO::LCWriter.

void SIO::SIOWriter::writeRunHeader ( const EVENT::LCRunHeader hdr)
throw (IO::IOException,
std::exception
)
virtual

Writes the given run header to file.

Exceptions
IOException

Implements IO::LCWriter.


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