| The Gaudi Framework v32r1 (f65d50dc)

Functions
Gaudi::Functional::details::zip Namespace Reference

## Functions
template<typename OS , typename Arg >
void | printSizes (OS &out, Arg &&arg)
| Print the parameter. More...
template<typename OS , typename Arg , typename... Args>
void | printSizes (OS &out, Arg &&arg, Args &&... args)
| Print the parameters. More...
template<typename A >
bool | check_sizes (const A &) noexcept
| Resolve case there is only one container in the range. More...
template<typename A , typename B >
bool | check_sizes (const A &a, const B &b) noexcept
| Compare sizes of two containers. More...
template<typename A , typename B , typename... C>
bool | check_sizes (const A &a, const B &b, const C &... c) noexcept
| Compare sizes of 3 or more containers. More...
template<typename... Args>
decltype(auto) | verifySizes (Args &... args)
| Verify the data container sizes have the same sizes. More...
template<typename... Args>
decltype(auto) | range (Args &&... args)
| Zips multiple containers together to form a single range. More...
template<typename... Args>
decltype(auto) | const_range (Args &&... args)
| Zips multiple containers together to form a single const range. More...

## Function Documentation

## ◆ check_sizes() [1/3]

template<typename A >

bool Gaudi::Functional::details::zip::check_sizes | ( | const A & |  | ) |
| inline noexcept

Resolve case there is only one container in the range.

Definition at line 42 of file FunctionalDetails.h.

42 {
43 return true;
44 }

## ◆ check_sizes() [2/3]

template<typename A , typename B >

bool Gaudi::Functional::details::zip::check_sizes | ( | const A & | a,
|  | const B & | b
| ) |  |
| inline noexcept

Compare sizes of two containers.

Definition at line 48 of file FunctionalDetails.h.

48 {
49 return a.size() == b.size();
50 }

## ◆ check_sizes() [3/3]

template<typename A , typename B , typename... C>

bool Gaudi::Functional::details::zip::check_sizes | ( | const A & | a,
|  | const B & | b,
|  | const C &... | c
| ) |  |
| inline noexcept

Compare sizes of 3 or more containers.

Definition at line 54 of file FunctionalDetails.h.

54 {
55 return ( check_sizes( a, b ) && check_sizes( b, c... ) );
56 }
gaudirun.c
c
Definition: gaudirun.py:487
Gaudi::Functional::details::zip::check_sizes
bool check_sizes(const A &a, const B &b, const C &... c) noexcept
Compare sizes of 3 or more containers.
Definition: FunctionalDetails.h:54

## ◆ const_range()

template<typename... Args>

decltype( auto ) Gaudi::Functional::details::zip::const_range | ( | Args &&... | args | ) |
| inline

Zips multiple containers together to form a single const range.

Definition at line 80 of file FunctionalDetails.h.

80 {
81 #ifndef NDEBUG
82 verifySizes( args... );
83 #endif
84 return ranges::view::const_( ranges::view::zip( std::forward<Args>( args )... ) );
85 }
gaudirun.args
args
Definition: gaudirun.py:307
Gaudi::Functional::details::zip::verifySizes
decltype(auto) verifySizes(Args &... args)
Verify the data container sizes have the same sizes.
Definition: FunctionalDetails.h:60

## ◆ printSizes() [1/2]

template<typename OS , typename Arg >

void Gaudi::Functional::details::zip::printSizes | ( | OS & | out,
|  | Arg && | arg
| ) |  |

Print the parameter.

Definition at line 28 of file FunctionalDetails.h.

28 {
29 out << "SizeOf'" << System::typeinfoName( typeid( Arg ) ) << "'=" << std::forward<Arg>( arg ).size();
30 }
System::typeinfoName
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:298
std::string::size
T size(T... args)

## ◆ printSizes() [2/2]

template<typename OS , typename Arg , typename... Args>

void Gaudi::Functional::details::zip::printSizes | ( | OS & | out,
|  | Arg && | arg,
|  | Args &&... | args
| ) |  |

Print the parameters.

Definition at line 34 of file FunctionalDetails.h.

34 {
35 printSizes( out, arg );
36 out << ", ";
37 printSizes( out, args... );
38 }
gaudirun.args
args
Definition: gaudirun.py:307
Gaudi::Functional::details::zip::printSizes
void printSizes(OS &out, Arg &&arg, Args &&... args)
Print the parameters.
Definition: FunctionalDetails.h:34

## ◆ range()

template<typename... Args>

decltype( auto ) Gaudi::Functional::details::zip::range | ( | Args &&... | args | ) |
| inline

Zips multiple containers together to form a single range.

Definition at line 71 of file FunctionalDetails.h.

71 {
72 #ifndef NDEBUG
73 verifySizes( args... );
74 #endif
75 return ranges::view::zip( std::forward<Args>( args )... );
76 }
gaudirun.args
args
Definition: gaudirun.py:307
Gaudi::Functional::details::zip::verifySizes
decltype(auto) verifySizes(Args &... args)
Verify the data container sizes have the same sizes.
Definition: FunctionalDetails.h:60

## ◆ verifySizes()

template<typename... Args>

decltype( auto ) Gaudi::Functional::details::zip::verifySizes | ( | Args &... | args | ) |
| inline

Verify the data container sizes have the same sizes.

Definition at line 60 of file FunctionalDetails.h.

60 {
61 if ( UNLIKELY( !check_sizes( args... ) ) ) {
62 std::ostringstream mess;
63 mess << "Zipped containers have different sizes : ";
64 printSizes( mess, args... );
65 throw GaudiException( mess.str(), "Gaudi::Functional::details::zip::verifySizes", StatusCode::FAILURE );
66 }
67 }
UNLIKELY
#define UNLIKELY(x)
Definition: Kernel.h:96
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:21
gaudirun.args
args
Definition: gaudirun.py:307
std::ostringstream
STL class.
std::ostringstream::str
T str(T... args)
Gaudi::Functional::details::zip::printSizes
void printSizes(OS &out, Arg &&arg, Args &&... args)
Print the parameters.
Definition: FunctionalDetails.h:34
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86
Gaudi::Functional::details::zip::check_sizes
bool check_sizes(const A &a, const B &b, const C &... c) noexcept
Compare sizes of 3 or more containers.
Definition: FunctionalDetails.h:54