Jpp  17.2.0
the software that should make you happy
 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) override
 Open file. More...
 
virtual bool hasNext () override
 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 189 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 196 of file JMonteCarloFileSupportkit.hh.

196  :
197  JFileReader_t<Head>(),
198  do_next(false)
199  {}

Member Function Documentation

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

Open file.

Parameters
file_namefile name

Definition at line 207 of file JMonteCarloFileSupportkit.hh.

208  {
209  JFileReader_t<Head>::open(file_name);
210 
211  do_next = true;
212  }
T * open(const std::string &file_name)
Open file.
Definition: JeepToolkit.hh:346
template<template< class > class JFileReader_t>
virtual bool JSUPPORT::JMonteCarloFileReader< Head, JFileReader_t >::hasNext ( )
inlineoverridevirtual

Check availability of next element.

Returns
true if the iteration has more elements; else false

Definition at line 220 of file JMonteCarloFileSupportkit.hh.

221  {
222  if (do_next) {
223 
224  do_next = false;
225 
226  return JFileReader_t<Head>::hasNext();
227 
228  } else {
229 
230  return false;
231  }
232  }

Member Data Documentation

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

Definition at line 235 of file JMonteCarloFileSupportkit.hh.


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