Jpp
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 123 of file JMonteCarloFileSupportkit.hh.

Constructor & Destructor Documentation

◆ JMonteCarloFileReader()

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

Default constructor.

Definition at line 130 of file JMonteCarloFileSupportkit.hh.

130  :
131  JFileReader_t<Head>(),
132  do_next(false)
133  {}

Member Function Documentation

◆ open()

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 141 of file JMonteCarloFileSupportkit.hh.

142  {
143  JFileReader_t<Head>::open(file_name);
144 
145  do_next = true;
146  }

◆ hasNext()

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 154 of file JMonteCarloFileSupportkit.hh.

155  {
156  if (do_next) {
157 
158  do_next = false;
159 
160  return JFileReader_t<Head>::hasNext();
161 
162  } else {
163 
164  return false;
165  }
166  }

Member Data Documentation

◆ do_next

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

Definition at line 169 of file JMonteCarloFileSupportkit.hh.


The documentation for this class was generated from the following file:
JSUPPORT::JMonteCarloFileReader< Head, JFileReader_t >::do_next
bool do_next
Definition: JMonteCarloFileSupportkit.hh:169
JEEP::open
T * open(const std::string &file_name)
Open file.
Definition: JeepToolkit.hh:302