Jpp  18.5.2
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Protected Attributes | List of all members
JTRIGGER::JClone< JContainer_t > Class Template Reference

Clone of a container. More...

#include <JClone.hh>

Inheritance diagram for JTRIGGER::JClone< JContainer_t >:
JTRIGGER::JHitToolkit< JContainer_t::value_type >

Public Types

typedef JContainer_t::value_type value_type
 
typedef JLANG::JClass
< value_type >::argument_type 
argument_type
 
typedef
JContainer_t::const_iterator 
const_iterator
 
typedef
JContainer_t::const_iterator 
iterator
 

Public Member Functions

 JClone ()
 Default constructor. More...
 
 JClone (const JContainer_t &input)
 Constructor. More...
 
iterator begin () const
 Get begin of data. More...
 
iterator end () const
 Get end of data. More...
 
unsigned int size () const
 Get size of data. More...
 
bool empty () const
 Check size of data. More...
 
void rewind () const
 Rewind internal iterator. More...
 
bool is_valid () const
 Check internal iterator. More...
 
void next () const
 Increment internal iterator. More...
 
iterator get () const
 Get internal iterator. More...
 
double getT () const
 Get time of internal iterator. More...
 
double getToT () const
 Get time-over-threshold of internal iterator. More...
 
JHit getJHit () const
 Construct JHit from internal iterator. More...
 
double getTimeDifference (argument_type hit) const
 Get time difference with respect to given hits. More...
 
iterator lower_bound (argument_type hit) const
 Set the internal iterator to the lower bound corresponding to the time of the given hit. More...
 
iterator fast_forward (argument_type hit) const
 Increment the internal iterator until the lower bound corresponding to the time of the given hit. More...
 

Protected Attributes

iterator __begin
 
iterator __end
 
iterator __i
 

Detailed Description

template<class JContainer_t>
class JTRIGGER::JClone< JContainer_t >

Clone of a container.

A JClone object contains a reference to container data and can be used as any normal container. It comprises in addition an internal iterator which is implemented as mutable data member.

The methods

can be used to check, set and access the internal iterator.

The data in the original container should have been terminated with an appriopriate end marker.

Definition at line 38 of file JClone.hh.

Member Typedef Documentation

template<class JContainer_t>
typedef JContainer_t::value_type JTRIGGER::JClone< JContainer_t >::value_type

Definition at line 43 of file JClone.hh.

template<class JContainer_t>
typedef JLANG::JClass<value_type>::argument_type JTRIGGER::JClone< JContainer_t >::argument_type

Definition at line 44 of file JClone.hh.

template<class JContainer_t>
typedef JContainer_t::const_iterator JTRIGGER::JClone< JContainer_t >::const_iterator

Definition at line 45 of file JClone.hh.

template<class JContainer_t>
typedef JContainer_t::const_iterator JTRIGGER::JClone< JContainer_t >::iterator

Definition at line 46 of file JClone.hh.

Constructor & Destructor Documentation

template<class JContainer_t>
JTRIGGER::JClone< JContainer_t >::JClone ( )
inline

Default constructor.

Definition at line 57 of file JClone.hh.

57  :
59  __begin(),
60  __end (),
61  __i ()
62  {}
iterator __end
Definition: JClone.hh:238
iterator __i
Definition: JClone.hh:239
iterator __begin
Definition: JClone.hh:237
Template definition of hit toolkit.
Definition: JHitToolkit.hh:60
template<class JContainer_t>
JTRIGGER::JClone< JContainer_t >::JClone ( const JContainer_t &  input)
inline

Constructor.

Parameters
inputinput

Definition at line 70 of file JClone.hh.

70  :
72  __begin(input.begin()),
73  __end (input.end ()),
74  __i (input.begin())
75  {}
iterator __end
Definition: JClone.hh:238
iterator __i
Definition: JClone.hh:239
iterator __begin
Definition: JClone.hh:237
Template definition of hit toolkit.
Definition: JHitToolkit.hh:60

Member Function Documentation

template<class JContainer_t>
iterator JTRIGGER::JClone< JContainer_t >::begin ( ) const
inline

Get begin of data.

Returns
begin of data

Definition at line 83 of file JClone.hh.

84  {
85  return __begin;
86  }
iterator __begin
Definition: JClone.hh:237
template<class JContainer_t>
iterator JTRIGGER::JClone< JContainer_t >::end ( ) const
inline

Get end of data.

Returns
end of data

Definition at line 94 of file JClone.hh.

95  {
96  return __end;
97  }
iterator __end
Definition: JClone.hh:238
template<class JContainer_t>
unsigned int JTRIGGER::JClone< JContainer_t >::size ( ) const
inline

Get size of data.

Returns
size of data

Definition at line 105 of file JClone.hh.

106  {
107  return std::distance(__begin, __end);
108  }
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance.
iterator __end
Definition: JClone.hh:238
iterator __begin
Definition: JClone.hh:237
template<class JContainer_t>
bool JTRIGGER::JClone< JContainer_t >::empty ( ) const
inline

Check size of data.

Returns
true if empty; else false

Definition at line 116 of file JClone.hh.

117  {
118  return __begin == __end;
119  }
iterator __end
Definition: JClone.hh:238
iterator __begin
Definition: JClone.hh:237
template<class JContainer_t>
void JTRIGGER::JClone< JContainer_t >::rewind ( ) const
inline

Rewind internal iterator.

Definition at line 125 of file JClone.hh.

126  {
127  __i = __begin;
128  }
iterator __i
Definition: JClone.hh:239
iterator __begin
Definition: JClone.hh:237
template<class JContainer_t>
bool JTRIGGER::JClone< JContainer_t >::is_valid ( ) const
inline

Check internal iterator.

Returns
true if internal iterator not yet at end; else false

Definition at line 136 of file JClone.hh.

137  {
138  return __i != __end;
139  }
iterator __end
Definition: JClone.hh:238
iterator __i
Definition: JClone.hh:239
template<class JContainer_t>
void JTRIGGER::JClone< JContainer_t >::next ( ) const
inline

Increment internal iterator.

Definition at line 145 of file JClone.hh.

146  {
147  ++__i;
148  }
iterator __i
Definition: JClone.hh:239
template<class JContainer_t>
iterator JTRIGGER::JClone< JContainer_t >::get ( ) const
inline

Get internal iterator.

Returns
internal operator

Definition at line 156 of file JClone.hh.

157  {
158  return __i;
159  }
iterator __i
Definition: JClone.hh:239
template<class JContainer_t>
double JTRIGGER::JClone< JContainer_t >::getT ( ) const
inline

Get time of internal iterator.

Returns
time of internal iterator [ns]

Definition at line 167 of file JClone.hh.

168  {
169  return getT(*__i);
170  }
iterator __i
Definition: JClone.hh:239
double getT() const
Get time of internal iterator.
Definition: JClone.hh:167
template<class JContainer_t>
double JTRIGGER::JClone< JContainer_t >::getToT ( ) const
inline

Get time-over-threshold of internal iterator.

Returns
time-over-threshold of hit [ns]

Definition at line 178 of file JClone.hh.

179  {
180  return getToT(*__i);
181  }
double getToT() const
Get time-over-threshold of internal iterator.
Definition: JClone.hh:178
iterator __i
Definition: JClone.hh:239
template<class JContainer_t>
JHit JTRIGGER::JClone< JContainer_t >::getJHit ( ) const
inline

Construct JHit from internal iterator.

Returns
hit

Definition at line 189 of file JClone.hh.

190  {
191  return getJHit(*__i);
192  }
JHit getJHit() const
Construct JHit from internal iterator.
Definition: JClone.hh:189
iterator __i
Definition: JClone.hh:239
template<class JContainer_t>
double JTRIGGER::JClone< JContainer_t >::getTimeDifference ( argument_type  hit) const
inline

Get time difference with respect to given hits.

Parameters
hithit
Returns
time of internal iterator - time hit [ns]

Definition at line 201 of file JClone.hh.

202  {
203  return getTimeDifference(hit, *__i);
204  }
iterator __i
Definition: JClone.hh:239
double getTimeDifference(argument_type hit) const
Get time difference with respect to given hits.
Definition: JClone.hh:201
template<class JContainer_t>
iterator JTRIGGER::JClone< JContainer_t >::lower_bound ( argument_type  hit) const
inline

Set the internal iterator to the lower bound corresponding to the time of the given hit.

Parameters
hithit
Returns
internal operator

Definition at line 213 of file JClone.hh.

214  {
215  return (__i = std::lower_bound(__begin, __end, hit, this->getToolkit()));
216  }
iterator __end
Definition: JClone.hh:238
iterator __i
Definition: JClone.hh:239
iterator __begin
Definition: JClone.hh:237
template<class JContainer_t>
iterator JTRIGGER::JClone< JContainer_t >::fast_forward ( argument_type  hit) const
inline

Increment the internal iterator until the lower bound corresponding to the time of the given hit.

Parameters
hithit
Returns
internal operator

Definition at line 225 of file JClone.hh.

226  {
229  ++__i;
230  }
231 
232  return __i;
233  }
iterator __i
Definition: JClone.hh:239
Template definition of hit toolkit.
Definition: JHitToolkit.hh:60

Member Data Documentation

template<class JContainer_t>
iterator JTRIGGER::JClone< JContainer_t >::__begin
protected

Definition at line 237 of file JClone.hh.

template<class JContainer_t>
iterator JTRIGGER::JClone< JContainer_t >::__end
protected

Definition at line 238 of file JClone.hh.

template<class JContainer_t>
iterator JTRIGGER::JClone< JContainer_t >::__i
mutableprotected

Definition at line 239 of file JClone.hh.


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