Jpp  19.1.0
the software that should make you happy
Public Types | Public Member Functions | Static Public Member Functions | Static Protected Attributes | List of all members
JLANG::JAccessibleObjectIterator< T > Class Template Referenceabstract

Interface for object iteration with named access. More...

#include <JObjectIterator.hh>

Inheritance diagram for JLANG::JAccessibleObjectIterator< T >:
JLANG::JObjectIterator< T > JLANG::JAccessible JLANG::JThrow< JAccessible > JIO::JBinaryFileReader< T, false > JIO::JBinaryFileReader< T, true > JLANG::JASCIIFileReader< T > JLANG::JAbstractAccessibleObjectReader< T > JLANG::JAccessibleAbstractObjectIterator< T > JLANG::JAccessibleObjectReader< T > JLANG::JGZFileReader< T > JROOT::JRootFileReader< T, false > JROOT::JTreeReaderAccessibleObjectIterator< T > JSUPPORT::JDAQFileReader< T, false > JSUPPORT::JDAQFileReader< T, true > JSUPPORT::JMonteCarloASCIIFileReader< T > JSUPPORT::JMonteCarloGZFileReader< T >

Public Types

typedef JPointer< T > pointer_type
 Type definition of pointer_type. More...
 

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...
 

Static Public Member Functions

static void Throw (const bool option)
 Enable/disable throw option. More...
 
static int Throw (const JException_t &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 JLANG::JAccessibleObjectIterator< T >

Interface for object iteration with named access.

Definition at line 374 of file JObjectIterator.hh.

Member Typedef Documentation

◆ pointer_type

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.

Member Function Documentation

◆ hasNext()

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

◆ next()

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

◆ skip()

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::JSTDObjectIterator< T >, JLANG::JPipe< T >, JLANG::JPipe< JTail_t >, JLANG::JPipe< JHead_t >, and JLANG::JAbstractObjectReader< 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  }
virtual const pointer_type & next()=0
Get next element.
virtual bool hasNext()=0
Check availability of next element.
unsigned int skip_type
Type definition for number of objects to skip.
std::vector< size_t > ns

◆ is_open()

virtual bool JLANG::JAccessible::is_open ( ) const
pure virtualinherited

◆ open()

virtual void JLANG::JAccessible::open ( const char *  file_name)
pure virtualinherited

◆ close()

virtual void JLANG::JAccessible::close ( )
pure virtualinherited

◆ Throw() [1/2]

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

◆ Throw() [2/2]

static int JLANG::JThrow< JAccessible >::Throw ( const JException_t &  error,
const int  value = -1 
)
inlinestaticinherited

Throw exception or return error.

Parameters
errorexception
valuereturn code
Returns
return code

Definition at line 51 of file JThrow.hh.

52  {
53  using namespace std;
54 
55  if (do_throw) {
56  throw error;
57  }
58 
59  cerr << error.what() << endl;
60 
61  return value;
62  }
Definition: JSTDTypes.hh:14

Member Data Documentation

◆ do_throw

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: