AFF --- A container for numbers (array) by Friederich and Forbriger.
histo.h
Go to the documentation of this file.
1
35
// include guard
36
#ifndef AFF_HISTO_H_VERSION
37
38
#define AFF_HISTO_H_VERSION \
39
"AFF_HISTO_H V1.0 "
40
41
42
#include<
aff/lib/collector.h
>
43
#include<map>
44
45
namespace
aff
{
46
47
namespace
func {
48
49
namespace
util {
50
58
template
<
class
C>
59
class
Extracthisto
{
60
typedef
typename
C::Tcoc
Tcont
;
61
typedef
typename
C::Tvalue
Tvalue
;
62
public
:
63
typedef
typename
std::map<Tvalue,int>
Tmap
;
64
typedef
Tmap
Tretval
;
66
Extracthisto
(
const
Tcont
& c) { }
68
void
operator()
(
const
Tvalue
& v)
69
{ ++
Mmap
[v]; }
71
Tretval
result
()
const
{
return
(
Mmap
); }
72
private
:
73
Tmap
Mmap
;
74
};
// class Extracthisto
75
76
}
// namespace util
77
78
/*----------------------------------------------------------------------*/
79
90
template
<
class
C>
91
typename
aff::func::util::Extracthisto<C>::Tmap
histo
(
const
C& c)
92
{
93
return
(aff::func::util::collect<C, aff::func::util::Extracthisto>(c));
94
}
// histo()
95
96
}
// namespace func
97
98
}
// namespace aff
99
100
#endif // AFF_HISTO_H_VERSION (includeguard)
101
102
/* ----- END OF histo.h ----- */
aff
Root namespace of library.
Definition:
array.h:148
collector.h
collect values (prototypes)
aff::func::util::Extracthisto
Definition:
histo.h:59
aff::func::util::Extracthisto::Tretval
Tmap Tretval
Definition:
histo.h:64
aff::func::util::Extracthisto::operator()
void operator()(const Tvalue &v)
collect another value
Definition:
histo.h:68
aff::func::histo
aff::func::util::Extracthisto< C >::Tmap histo(const C &c)
Definition:
histo.h:91
aff::func::util::Extracthisto::Mmap
Tmap Mmap
Definition:
histo.h:73
aff::func::util::Extracthisto::Extracthisto
Extracthisto(const Tcont &c)
initialize member data
Definition:
histo.h:66
aff::func::util::Extracthisto::Tmap
std::map< Tvalue, int > Tmap
Definition:
histo.h:63
aff::func::util::Extracthisto::result
Tretval result() const
return result of operation
Definition:
histo.h:71
aff::func::util::Extracthisto::Tvalue
C::Tvalue Tvalue
Definition:
histo.h:61
aff::func::util::Extracthisto::Tcont
C::Tcoc Tcont
Definition:
histo.h:60
functions
histo.h
Generated on Mon Aug 21 2023 17:36:08 for AFF --- A container for numbers (array) by Friederich and Forbriger. by
1.8.14