Jpp 19.3.0-rc.3
the software that should make you happy
Loading...
Searching...
No Matches
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.
 
virtual void open (const char *file_name) override
 Open file.
 
virtual bool hasNext () override
 Check availability of next element.
 

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

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

Member Function Documentation

◆ open()

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

264 {
265 JFileReader_t<Head>::open(file_name);
266
267 do_next = true;
268 }

◆ hasNext()

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

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

Member Data Documentation

◆ do_next

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

Definition at line 291 of file JMonteCarloFileSupportkit.hh.


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