Public Types | Public Member Functions | Protected Attributes

mln::accu::pair< A1, A2, T > Struct Template Reference
[Multiple accumulators]

Generic pair of accumulators. More...

#include <pair.hh>

Inheritance diagram for mln::accu::pair< A1, A2, T >:
Inheritance graph

List of all members.

Public Types

typedef T argument
typedef Accumulator< void > category
typedef pair< A1, A2, T > exact_t
typedef std::pair< A1::result,
A2::result > 
q_result
typedef mln::metal::unqualif
< std::pair< A1::result,
A2::result > >::ret 
result
typedef A1::result result_1
typedef A2::result result_2

Public Member Functions

A1::result first () const
 Return the result of the first accumulator.
A1 first_accu () const
 Return the first accumulator.
bool is_valid () const
 Check whether this accu is able to return a result.
 pair ()
A2::result second () const
 Return the result of the second accumulator.
A2 second_accu () const
 Return the second accumulator.
std::pair< A1::result, A2::result > subj_ ()
void take_as_init (const T &t)
 Take as initialization the value t.
void take_as_init_ (const T &t)
 Default implementation of "take as initialization".
void take_n_times (unsigned n, const T &t)
 Take n times the value t.
void take_n_times_ (unsigned n, const T &t)
 Default implementation of "take n times".

void init ()
 Manipulators.
void take_as_init_ (const argument &t)
void take (const argument &t)
void take (const pair< A1, A2, T > &other)

std::pair< typename A1::result,
typename A2::result > 
to_result () const
 Get the value of the accumulator.
void get_result (result_1 &r1, result_2 &r2) const

Protected Attributes

A1 a1_
A2 a2_

Detailed Description

template<typename A1, typename A2, typename T = mln_argument(A1)>
struct mln::accu::pair< A1, A2, T >

Generic pair of accumulators.

The parameter T is the type of values.

Todo:
Check that, when T is not provided, A1 and A2 have the same value.

Definition at line 58 of file pair.hh.


Member Typedef Documentation

template<typename A1, typename A2, typename T = mln_argument(A1)>
typedef T mln::accu::pair< A1, A2, T >::argument

Definition at line 61 of file pair.hh.

typedef Accumulator<void> mln::Accumulator< pair< A1, A2, T > >::category [inherited]

Reimplemented from mln::Proxy< pair< A1, A2, T > >.

Definition at line 80 of file accumulator.hh.

typedef pair< A1, A2, T > mln::Object< pair< A1, A2, T > >::exact_t [inherited]

Definition at line 173 of file object.hh.

typedef std::pair< A1::result, A2::result > mln::accu::internal::base< std::pair< A1::result, A2::result > , pair< A1, A2, T > >::q_result [inherited]

Definition at line 58 of file base.hh.

typedef mln::metal::unqualif< std::pair< A1::result, A2::result > >::ret mln::accu::internal::base< std::pair< A1::result, A2::result > , pair< A1, A2, T > >::result [inherited]

Definition at line 59 of file base.hh.

template<typename A1, typename A2, typename T = mln_argument(A1)>
typedef A1 ::result mln::accu::pair< A1, A2, T >::result_1

Definition at line 63 of file pair.hh.

template<typename A1, typename A2, typename T = mln_argument(A1)>
typedef A2 ::result mln::accu::pair< A1, A2, T >::result_2

Definition at line 64 of file pair.hh.


Constructor & Destructor Documentation

template<typename A1 , typename A2 , typename T >
mln::accu::pair< A1, A2, T >::pair (  )  [inline]

Definition at line 128 of file pair.hh.

References mln::accu::pair< A1, A2, T >::init().


Member Function Documentation

template<typename A1 , typename A2 , typename T >
A1::result mln::accu::pair< A1, A2, T >::first (  )  const [inline]

Return the result of the first accumulator.

Definition at line 191 of file pair.hh.

template<typename A1 , typename A2 , typename T >
A1 mln::accu::pair< A1, A2, T >::first_accu (  )  const [inline]

Return the first accumulator.

Definition at line 209 of file pair.hh.

template<typename A1 , typename A2 , typename T >
void mln::accu::pair< A1, A2, T >::get_result ( result_1 r1,
result_2 r2 
) const [inline]

Definition at line 181 of file pair.hh.

template<typename A1 , typename A2 , typename T >
void mln::accu::pair< A1, A2, T >::init (  )  [inline]

Manipulators.

Definition at line 136 of file pair.hh.

Referenced by mln::accu::pair< A1, A2, T >::pair().

template<typename A1 , typename A2 , typename T >
bool mln::accu::pair< A1, A2, T >::is_valid (  )  const [inline]

Check whether this accu is able to return a result.

Always true here.

Definition at line 226 of file pair.hh.

template<typename A1 , typename A2 , typename T >
A2::result mln::accu::pair< A1, A2, T >::second (  )  const [inline]

Return the result of the second accumulator.

Definition at line 199 of file pair.hh.

template<typename A1 , typename A2 , typename T >
A2 mln::accu::pair< A1, A2, T >::second_accu (  )  const [inline]

Return the second accumulator.

Definition at line 217 of file pair.hh.

std::pair< A1::result, A2::result > mln::accu::internal::base< std::pair< A1::result, A2::result > , pair< A1, A2, T > >::subj_ (  )  [inherited]
template<typename A1, typename A2, typename T>
void mln::accu::pair< A1, A2, T >::take ( const pair< A1, A2, T > &  other  )  [inline]
template<typename A1 , typename A2 , typename T >
void mln::accu::pair< A1, A2, T >::take ( const argument t  )  [inline]

Definition at line 154 of file pair.hh.

void mln::Accumulator< pair< A1, A2, T > >::take_as_init ( const T &  t  )  [inherited]

Take as initialization the value t.

Dev note: this is a final method; override if needed by take_as_init_ (ending with '_').

template<typename A1 , typename A2 , typename T >
void mln::accu::pair< A1, A2, T >::take_as_init_ ( const argument t  )  [inline]

Definition at line 145 of file pair.hh.

void mln::Accumulator< pair< A1, A2, T > >::take_as_init_ ( const T &  t  )  [inherited]

Default implementation of "take as initialization".

void mln::Accumulator< pair< A1, A2, T > >::take_n_times ( unsigned  n,
const T &  t 
) [inherited]

Take n times the value t.

Dev note: this is a final method; override if needed by take_as_init_ (ending with '_').

void mln::Accumulator< pair< A1, A2, T > >::take_n_times_ ( unsigned  n,
const T &  t 
) [inherited]

Default implementation of "take n times".

template<typename A1 , typename A2 , typename T >
std::pair< typename A1::result, typename A2::result > mln::accu::pair< A1, A2, T >::to_result (  )  const [inline]

Get the value of the accumulator.

Definition at line 172 of file pair.hh.


Member Data Documentation

template<typename A1, typename A2, typename T = mln_argument(A1)>
A1 mln::accu::pair< A1, A2, T >::a1_ [protected]

Definition at line 100 of file pair.hh.

Referenced by mln::accu::pair< A1, A2, T >::take().

template<typename A1, typename A2, typename T = mln_argument(A1)>
A2 mln::accu::pair< A1, A2, T >::a2_ [protected]

Definition at line 101 of file pair.hh.

Referenced by mln::accu::pair< A1, A2, T >::take().