Jpp
software
JROOT
JCounter.hh
Go to the documentation of this file.
1
#ifndef __JROOT__JCOUNTER__
2
#define __JROOT__JCOUNTER__
3
4
#include <limits>
5
6
#include "Rtypes.h"
7
8
9
/**
10
* \file
11
*
12
* Type definition for counter for ROOT TTree and auxiliary methods.
13
* \author mdejong
14
*/
15
namespace
JROOT
{}
16
namespace
JPP
{
using namespace
JROOT
; }
17
18
namespace
JROOT
{
19
20
21
/**
22
* Type definition for counter.
23
*/
24
typedef
Long64_t
counter_type
;
25
26
27
/**
28
* Advance counter.
29
*
30
* \param counter counter (I/O)
31
* \param value offset
32
* \param limit limit
33
* \return increment
34
*/
35
inline
counter_type
advance
(
counter_type
& counter,
36
const
counter_type
value,
37
const
counter_type
limit = std::numeric_limits<counter_type>::max())
38
{
39
const
counter_type
previous = counter;
40
41
if
(counter + value < limit)
42
counter += value;
43
else
44
counter = limit;
45
46
return
counter - previous;
47
}
48
}
49
50
#endif
JROOT
Auxiliary classes and methods for ROOT I/O.
Definition:
JAbstractStreamer.hh:13
JROOT::advance
counter_type advance(counter_type &counter, const counter_type value, const counter_type limit=std::numeric_limits< counter_type >::max())
Advance counter.
Definition:
JCounter.hh:35
JPP
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Definition:
JAAnetToolkit.hh:37
JROOT::counter_type
Long64_t counter_type
Type definition for counter.
Definition:
JCounter.hh:24
Generated by
1.8.16