Jpp 21.0.0
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 253 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 260 of file JMonteCarloFileSupportkit.hh.

260 :
261 JFileReader_t<Head>(),
262 do_next(false)
263 {}

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

272 {
273 JFileReader_t<Head>::open(file_name);
274
275 do_next = true;
276 }

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

285 {
286 if (do_next) {
287
288 do_next = false;
289
290 return JFileReader_t<Head>::hasNext();
291
292 } else {
293
294 return false;
295 }
296 }

Member Data Documentation

◆ do_next

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

Definition at line 299 of file JMonteCarloFileSupportkit.hh.


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