| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

HepMC::IO_BaseClass Class Reference

If you want to write a new IO class, then inherit from this class and re-define read_event() and write_event(). More...

#include <IO_BaseClass.h>

Inheritance diagram for HepMC::IO_BaseClass:

[legend]
List of all members.

Public Member Functions

virtual ~IO_BaseClass ()
virtual void write_event (const GenEvent *)=0
 write this GenEvent
virtual bool fill_next_event (GenEvent *)=0
 fill this GenEvent
virtual void write_particle_data_table (const ParticleDataTable *)=0
 write this ParticleDataTable
virtual bool fill_particle_data_table (ParticleDataTable *)=0
 fill this ParticleDataTable
virtual void print (std::ostream &ostr=std::cout) const
 write output to ostr
GenEventread_next_event ()
 do not over-ride
ParticleDataTableread_particle_data_table ()
 do not over-ride
virtual GenEvent *& operator>> (GenEvent *&)
 the same as read_next_event
virtual const GenEvent *& operator<< (const GenEvent *&)
 the same as write_event
virtual GenEvent *& operator<< (GenEvent *&)
 the same as write_event
virtual ParticleDataTable *& operator>> (ParticleDataTable *&)
 the same as read_particle_data_table
virtual const ParticleDataTable *& operator<< (const ParticleDataTable *&)
 the same as write_particle_data_table
virtual ParticleDataTable *& operator<< (ParticleDataTable *&)
 the same as write_particle_data_table

Detailed Description

If you want to write a new IO class, then inherit from this class and re-define read_event() and write_event().

Definition at line 35 of file IO_BaseClass.h.


Constructor & Destructor Documentation

virtual HepMC::IO_BaseClass::~IO_BaseClass (  )  [inline, virtual]

Definition at line 37 of file IO_BaseClass.h.

00037 {}


Member Function Documentation

virtual void HepMC::IO_BaseClass::write_event ( const GenEvent  )  [pure virtual]

write this GenEvent

Implemented in HepMC::IO_Ascii, HepMC::IO_AsciiParticles, HepMC::IO_ExtendedAscii, HepMC::IO_GenEvent, HepMC::IO_HEPEVT, HepMC::IO_HERWIG, and HepMC::IO_PDG_ParticleDataTable.

virtual bool HepMC::IO_BaseClass::fill_next_event ( GenEvent  )  [pure virtual]

fill this GenEvent

Implemented in HepMC::IO_Ascii, HepMC::IO_AsciiParticles, HepMC::IO_ExtendedAscii, HepMC::IO_GenEvent, HepMC::IO_HEPEVT, HepMC::IO_HERWIG, and HepMC::IO_PDG_ParticleDataTable.

virtual void HepMC::IO_BaseClass::write_particle_data_table ( const ParticleDataTable  )  [pure virtual]

write this ParticleDataTable

Implemented in HepMC::IO_Ascii, HepMC::IO_AsciiParticles, HepMC::IO_ExtendedAscii, HepMC::IO_GenEvent, HepMC::IO_HEPEVT, HepMC::IO_HERWIG, and HepMC::IO_PDG_ParticleDataTable.

virtual bool HepMC::IO_BaseClass::fill_particle_data_table ( ParticleDataTable  )  [pure virtual]

fill this ParticleDataTable

Implemented in HepMC::IO_Ascii, HepMC::IO_AsciiParticles, HepMC::IO_ExtendedAscii, HepMC::IO_GenEvent, HepMC::IO_HEPEVT, HepMC::IO_HERWIG, and HepMC::IO_PDG_ParticleDataTable.

void HepMC::IO_BaseClass::print ( std::ostream &  ostr = std::cout  )  const [inline, virtual]

write output to ostr

Reimplemented in HepMC::IO_Ascii, HepMC::IO_AsciiParticles, HepMC::IO_ExtendedAscii, HepMC::IO_GenEvent, HepMC::IO_HEPEVT, HepMC::IO_HERWIG, and HepMC::IO_PDG_ParticleDataTable.

Definition at line 117 of file IO_BaseClass.h.

00117                                                             { 
00118         ostr << "IO_BaseClass: abstract parent I/O class. " <<  std::endl;
00119     }

GenEvent * HepMC::IO_BaseClass::read_next_event (  )  [inline]

do not over-ride

creates a new event and fills it by calling the sister method read_next_event( GenEvent* )

Definition at line 87 of file IO_BaseClass.h.

00087                                                    {
00090         // 
00091         // 1. create an empty event container
00092         GenEvent* evt = new GenEvent();
00093         // 2. fill the evt container - if the read is successful, return the
00094         //    pointer, otherwise return null and delete the evt
00095         if ( fill_next_event( evt ) ) return evt;
00096         // note: the below delete is only reached if read fails
00097         //       ... thus there is not much overhead in new then delete 
00098         //       since this statement is rarely reached
00099         delete evt;
00100         return 0;
00101     }

ParticleDataTable * HepMC::IO_BaseClass::read_particle_data_table (  )  [inline]

do not over-ride

creates a new particle data table and fills it by calling the sister method read_particle_data_table( ParticleDataTable* )

Definition at line 103 of file IO_BaseClass.h.

00103                                                                      {
00106         //
00107         // 1. create an empty pdt
00108         ParticleDataTable* pdt = new ParticleDataTable();
00109         // 2. fill the pdt container - if the read is successful, return the
00110         //    pointer, otherwise return null and delete the evt
00111         if ( fill_particle_data_table( pdt ) ) return pdt;
00112         // next statement is only reached if read fails
00113         delete pdt;
00114         return 0;
00115     }

GenEvent *& HepMC::IO_BaseClass::operator>> ( GenEvent *&   )  [inline, virtual]

the same as read_next_event

Definition at line 121 of file IO_BaseClass.h.

00121                                                               {
00122         evt = read_next_event();
00123         return evt;
00124     }

const GenEvent *& HepMC::IO_BaseClass::operator<< ( const GenEvent *&   )  [inline, virtual]

the same as write_event

Definition at line 126 of file IO_BaseClass.h.

00127                                                                      {
00128         write_event( evt );
00129         return evt;
00130     }

GenEvent *& HepMC::IO_BaseClass::operator<< ( GenEvent *&   )  [inline, virtual]

the same as write_event

Definition at line 132 of file IO_BaseClass.h.

00132                                                                {
00133         write_event( evt );
00134         return evt;
00135     }

ParticleDataTable *& HepMC::IO_BaseClass::operator>> ( ParticleDataTable *&   )  [inline, virtual]

the same as read_particle_data_table

Definition at line 137 of file IO_BaseClass.h.

00138                                                                     {
00139         pdt = read_particle_data_table();
00140         return pdt;
00141     }

const ParticleDataTable *& HepMC::IO_BaseClass::operator<< ( const ParticleDataTable *&   )  [inline, virtual]

the same as write_particle_data_table

Definition at line 143 of file IO_BaseClass.h.

00144                                                                              {
00145         write_particle_data_table( pdt );
00146         return pdt;
00147     }

ParticleDataTable *& HepMC::IO_BaseClass::operator<< ( ParticleDataTable *&   )  [inline, virtual]

the same as write_particle_data_table

Definition at line 149 of file IO_BaseClass.h.

00150                                                                               {
00151         write_particle_data_table( pdt );
00152         return pdt;
00153     }


The documentation for this class was generated from the following file:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 19:56:44 2011 for HepMC by doxygen 1.4.7