Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Static Public Member Functions | Static Protected Attributes | List of all members
JSUPPORT::JMonteCarloGZFileReader< T > Class Template Referenceabstract

Template definition of Monte Carlo object reader for gzipped ASCII formatted file (i.e. '.gz') More...

#include <JMonteCarloFileReader.hh>

Inheritance diagram for JSUPPORT::JMonteCarloGZFileReader< T >:
JLANG::JAccessibleObjectIterator< T > JLANG::JNullAccess JLANG::JNullIterator< T > JLANG::JObjectIterator< T > JLANG::JAccessible JLANG::JAccessible JLANG::JObjectIterator< T > JLANG::JThrow< JAccessible > JLANG::JThrow< JAccessible >

Public Types

typedef JPointer< Tpointer_type
 Type definition of pointer_type. More...
 
typedef JObjectIterator< T >
::pointer_type 
pointer_type
 

Public Member Functions

virtual bool hasNext ()=0
 Check availability of next element. More...
 
virtual const pointer_typenext ()=0
 Get next element. More...
 
virtual skip_type skip (const skip_type ns)
 Skip items. More...
 
virtual bool is_open () const =0
 Check is device is open. More...
 
virtual void open (const char *file_name)=0
 Open device. More...
 
virtual void close ()=0
 Close device. More...
 
virtual bool is_open () const override
 Check is device is open. More...
 
virtual void open (const char *file_name) override
 Open device. More...
 
virtual void close () override
 Close device. More...
 
virtual bool hasNext ()
 Check availability of next element. More...
 
virtual const pointer_typenext ()
 Get next element. More...
 

Static Public Member Functions

static void Throw (const bool option)
 Enable/disable throw option. More...
 
static int Throw (const JException &error, const int value=-1)
 Throw exception or return error. More...
 

Static Protected Attributes

static bool do_throw
 throw option More...
 

Detailed Description

template<class T>
class JSUPPORT::JMonteCarloGZFileReader< T >

Template definition of Monte Carlo object reader for gzipped ASCII formatted file (i.e. '.gz')

This class provides for a null implementation of the JLANG::JAccessibleObjectIterator interface. It should be specialised for the data types that will be read from a Monte Carlo file.

Definition at line 42 of file JMonteCarloFileReader.hh.

Member Typedef Documentation

template<class T>
typedef JPointer<T> JLANG::JObjectIterator< T >::pointer_type
inherited

Type definition of pointer_type.

Definition at line 58 of file JObjectIterator.hh.

template<class T >
typedef JObjectIterator<T>::pointer_type JLANG::JNullIterator< T >::pointer_type
inherited

Definition at line 331 of file JObjectIterator.hh.

Member Function Documentation

template<class T>
virtual bool JLANG::JObjectIterator< T >::hasNext ( )
pure virtualinherited

Check availability of next element.

Returns
true if the iteration has more elements; else false

Implemented in JSUPPORT::JMultipleFileScanner< T >, JSUPPORT::JMultipleFileScanner<>, JSUPPORT::JMultipleFileScanner< JTail_t >, JSUPPORT::JMultipleFileScanner< JHead_t >, JSUPPORT::JMultipleFileScanner< KM3NETDAQ::KM3NETDAQ::JDAQEvent >, JSUPPORT::JMultipleFileScanner< JDAQSummaryslice >, JSUPPORT::JMultipleFileScanner< JTypeList< JDAQEvent, JTypelist_t > >, JLANG::JNullIterator< T >, JSUPPORT::JSingleFileScanner< T >, JSUPPORT::JSingleFileScanner<>, JSUPPORT::JSingleFileScanner< JTail_t >, JSUPPORT::JSingleFileScanner< JHead_t >, JLANG::JObjectMultiplexer< JTypeList< JHead_t, JTail_t >, JBase_t >, JROOT::JRootFileReader< T, false >, JROOT::JMarkerAttributes, JROOT::JLineAttributes, JSUPPORT::JTriggeredFileScanner< JTypelist_t >, JLANG::JObjectSampler< T, JSampler_t >, JLANG::JObjectSampler< JDAQSummaryslice, JRandomSampler >, JLANG::JPipe< T >, JLANG::JSTDObjectIterator< T >, JLANG::JPipe< JTail_t >, JLANG::JPipe< JHead_t >, JROOT::JTreeReaderObjectIterator< T >, JLANG::JObjectMultiplexer< JDerived_t, JBase_t >, JLANG::JObjectMultiplexer< JHead_t, JBase_t >, JLANG::JObjectMultiplexer< JTail_t, JBase_t >, JLANG::JAbstractObjectIterator< T >, JLANG::JAbstractObjectIterator< Head >, JLANG::JAbstractObjectIterator< JTail_t >, JLANG::JAbstractObjectIterator< JHead_t >, JLANG::JAbstractObjectIterator< JTriggerParameters >, JLANG::JAbstractObjectIterator< JPhotonPath >, JLANG::JAbstractObjectReader< T >, JLANG::JConversionIterator< JInput_t, JOutput_t >, JLANG::JAbstractObjectReader< JNullType >, JLANG::JAbstractObjectReader< const T >, JLANG::JAbstractObjectReader< JTail_t >, JLANG::JAbstractObjectReader< JHead_t >, JLANG::JAbstractObjectReader< KM3NETDAQ::KM3NETDAQ::JDAQEvent >, JLANG::JAbstractObjectReader< JDAQSummaryslice >, and JLANG::JAbstractObjectReader< JTypeList< JDAQEvent, JTypelist_t > >.

template<class T>
virtual const pointer_type& JLANG::JObjectIterator< T >::next ( )
pure virtualinherited

Get next element.

Returns
pointer to element

Implemented in JSUPPORT::JMultipleFileScanner< T >, JSUPPORT::JMultipleFileScanner<>, JSUPPORT::JMultipleFileScanner< JTail_t >, JSUPPORT::JMultipleFileScanner< JHead_t >, JSUPPORT::JMultipleFileScanner< KM3NETDAQ::KM3NETDAQ::JDAQEvent >, JSUPPORT::JMultipleFileScanner< JDAQSummaryslice >, JSUPPORT::JMultipleFileScanner< JTypeList< JDAQEvent, JTypelist_t > >, JLANG::JNullIterator< T >, JSUPPORT::JSingleFileScanner< T >, JSUPPORT::JSingleFileScanner<>, JSUPPORT::JSingleFileScanner< JTail_t >, JSUPPORT::JSingleFileScanner< JHead_t >, JLANG::JObjectMultiplexer< JTypeList< JHead_t, JTail_t >, JBase_t >, JROOT::JRootFileReader< T, false >, JLANG::JObjectSampler< T, JSampler_t >, JLANG::JObjectSampler< JDAQSummaryslice, JRandomSampler >, JROOT::JMarkerAttributes, JLANG::JPipe< T >, JSUPPORT::JTriggeredFileScanner< JTypelist_t >, JLANG::JPipe< JTail_t >, JLANG::JPipe< JHead_t >, JROOT::JLineAttributes, JROOT::JTreeReaderObjectIterator< T >, JLANG::JSTDObjectIterator< T >, JLANG::JObjectMultiplexer< JDerived_t, JBase_t >, JLANG::JObjectMultiplexer< JHead_t, JBase_t >, JLANG::JObjectMultiplexer< JTail_t, JBase_t >, JSUPPORT::JParallelFileScanner< JTypeList< JDAQEvent, JTypelist_t >, JMultipleFileScanner >, JLANG::JAbstractObjectIterator< T >, JLANG::JAbstractObjectIterator< Head >, JLANG::JAbstractObjectIterator< JTail_t >, JLANG::JAbstractObjectIterator< JHead_t >, JLANG::JAbstractObjectIterator< JTriggerParameters >, JLANG::JAbstractObjectIterator< JPhotonPath >, JLANG::JAbstractObjectReader< T >, JLANG::JConversionIterator< JInput_t, JOutput_t >, JLANG::JAbstractObjectReader< JNullType >, JLANG::JAbstractObjectReader< const T >, JLANG::JAbstractObjectReader< JTail_t >, JLANG::JAbstractObjectReader< JHead_t >, JLANG::JAbstractObjectReader< KM3NETDAQ::KM3NETDAQ::JDAQEvent >, JLANG::JAbstractObjectReader< JDAQSummaryslice >, and JLANG::JAbstractObjectReader< JTypeList< JDAQEvent, JTypelist_t > >.

template<class T>
virtual skip_type JLANG::JObjectIterator< T >::skip ( const skip_type  ns)
inlinevirtualinherited

Skip items.

Parameters
nsnumber of items to skip
Returns
number of items skipped

Reimplemented in JLANG::JPipe< T >, JLANG::JPipe< JTail_t >, JLANG::JPipe< JHead_t >, JLANG::JSTDObjectIterator< T >, JLANG::JAbstractObjectReader< T >, JLANG::JAbstractObjectReader< JNullType >, JLANG::JAbstractObjectReader< const T >, JLANG::JAbstractObjectReader< JTail_t >, JLANG::JAbstractObjectReader< JHead_t >, JLANG::JAbstractObjectReader< KM3NETDAQ::KM3NETDAQ::JDAQEvent >, JLANG::JAbstractObjectReader< JDAQSummaryslice >, and JLANG::JAbstractObjectReader< JTypeList< JDAQEvent, JTypelist_t > >.

Definition at line 90 of file JObjectIterator.hh.

91  {
92  skip_type i = 0;
93 
94  for ( ; i != ns && hasNext(); ++i) {
95  next();
96  }
97 
98  return i;
99  }
unsigned int skip_type
Type definition for number of objects to skip.
virtual const pointer_type & next()=0
Get next element.
virtual bool hasNext()=0
Check availability of next element.
virtual bool JLANG::JAccessible::is_open ( ) const
pure virtualinherited
virtual void JLANG::JAccessible::open ( const char *  file_name)
pure virtualinherited
virtual void JLANG::JAccessible::close ( )
pure virtualinherited
static void JLANG::JThrow< JAccessible >::Throw ( const bool  option)
inlinestaticinherited

Enable/disable throw option.

Parameters
optiontrue enable; false disable

Definition at line 37 of file JThrow.hh.

38  {
39  do_throw = option;
40  }
static bool do_throw
throw option
Definition: JThrow.hh:28
static int JLANG::JThrow< JAccessible >::Throw ( const JException error,
const int  value = -1 
)
inlinestaticinherited

Throw exception or return error.

Parameters
errorexception
valuereturn code
Returns
return code

Definition at line 50 of file JThrow.hh.

51  {
52  using namespace std;
53 
54  if (do_throw) {
55  throw error;
56  }
57 
58  cerr << error.what() << endl;
59 
60  return value;
61  }
virtual const char * what() const override
Get error message.
Definition: JException.hh:48
static bool do_throw
throw option
Definition: JThrow.hh:28
virtual bool JLANG::JNullAccess::is_open ( ) const
inlineoverridevirtualinherited

Check is device is open.

Returns
true

Implements JLANG::JAccessible.

Definition at line 74 of file JAccessible.hh.

75  {
76  return true;
77  }
virtual void JLANG::JNullAccess::open ( const char *  file_name)
inlineoverridevirtualinherited

Open device.

Parameters
file_namefile name

Implements JLANG::JAccessible.

Definition at line 85 of file JAccessible.hh.

86  {}
virtual void JLANG::JNullAccess::close ( )
inlineoverridevirtualinherited

Close device.

Implements JLANG::JAccessible.

Definition at line 92 of file JAccessible.hh.

93  {}
template<class T >
virtual bool JLANG::JNullIterator< T >::hasNext ( )
inlinevirtualinherited

Check availability of next element.

Returns
false

Implements JLANG::JObjectIterator< T >.

Definition at line 339 of file JObjectIterator.hh.

340  {
341  return false;
342  }
template<class T >
virtual const pointer_type& JLANG::JNullIterator< T >::next ( )
inlinevirtualinherited

Get next element.

Returns
NULL

Implements JLANG::JObjectIterator< T >.

Definition at line 350 of file JObjectIterator.hh.

351  {
352  return ps;
353  }

Member Data Documentation

bool JLANG::JThrow< JAccessible >::do_throw
staticprotectedinherited

throw option

Set default throw option to true.

Definition at line 28 of file JThrow.hh.


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