Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Attributes | List of all members
JSUPPORT::JMonteCarloFileReader< Head, JFileReader_t > Class Template Reference

Template specialisation of JMonteCarloFileReader for Head. More...

#include <JMonteCarloFileSupportkit.hh>

Inheritance diagram for JSUPPORT::JMonteCarloFileReader< Head, JFileReader_t >:

Public Member Functions

 JMonteCarloFileReader ()
 Default constructor. More...
 
virtual void open (const char *file_name)
 Open file. More...
 
virtual bool hasNext ()
 Check availability of next element. More...
 

Private Attributes

bool do_next
 

Detailed Description

template<template< class > class JFileReader_t>
class JSUPPORT::JMonteCarloFileReader< Head, JFileReader_t >

Template specialisation of JMonteCarloFileReader for Head.

This class re-implements the methods open of the JLANG::JAccessible and method hasNext of the JLANG::JObjectIterator interface so that only one Head is read per file.

Definition at line 156 of file JMonteCarloFileSupportkit.hh.

Constructor & Destructor Documentation

template<template< class > class JFileReader_t>
JSUPPORT::JMonteCarloFileReader< Head, JFileReader_t >::JMonteCarloFileReader ( )
inline

Default constructor.

Definition at line 163 of file JMonteCarloFileSupportkit.hh.

163  :
164  JFileReader_t<Head>(),
165  do_next(false)
166  {}

Member Function Documentation

template<template< class > class JFileReader_t>
virtual void JSUPPORT::JMonteCarloFileReader< Head, JFileReader_t >::open ( const char *  file_name)
inlinevirtual

Open file.

Parameters
file_namefile name

Definition at line 174 of file JMonteCarloFileSupportkit.hh.

175  {
176  JFileReader_t<Head>::open(file_name);
177 
178  do_next = true;
179  }
T * open(const std::string &file_name)
Open file.
Definition: JeepToolkit.hh:306
template<template< class > class JFileReader_t>
virtual bool JSUPPORT::JMonteCarloFileReader< Head, JFileReader_t >::hasNext ( )
inlinevirtual

Check availability of next element.

Returns
true if the iteration has more elements; else false

Definition at line 187 of file JMonteCarloFileSupportkit.hh.

188  {
189  if (do_next) {
190 
191  do_next = false;
192 
193  return JFileReader_t<Head>::hasNext();
194 
195  } else {
196 
197  return false;
198  }
199  }

Member Data Documentation

template<template< class > class JFileReader_t>
bool JSUPPORT::JMonteCarloFileReader< Head, JFileReader_t >::do_next
private

Definition at line 202 of file JMonteCarloFileSupportkit.hh.


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