Jpp  18.6.0-rc.1
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 246 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 253 of file JMonteCarloFileSupportkit.hh.

253  :
254  JFileReader_t<Head>(),
255  do_next(false)
256  {}

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

265  {
266  JFileReader_t<Head>::open(file_name);
267 
268  do_next = true;
269  }
T * open(const std::string &file_name)
Open file.
Definition: JeepToolkit.hh:351
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 277 of file JMonteCarloFileSupportkit.hh.

278  {
279  if (do_next) {
280 
281  do_next = false;
282 
283  return JFileReader_t<Head>::hasNext();
284 
285  } else {
286 
287  return false;
288  }
289  }

Member Data Documentation

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

Definition at line 292 of file JMonteCarloFileSupportkit.hh.


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