| The Gaudi Framework v29r1 (5cd95fa2)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Namespace List
- Namespace Members

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

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 52 of file FunctionalDetails.h.

53 {
54 return true;
55 }
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 59 of file FunctionalDetails.h.

60 {
61 return a.size() == b.size();
62 }
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 66 of file FunctionalDetails.h.

67 {
68 return ( check_sizes( a, b ) && check_sizes( b, c... ) );
69 }
gaudirun.c
c
Definition: gaudirun.py:407
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:66
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 94 of file FunctionalDetails.h.

95 {
96 // assert( check_sizes( args... ) );
97 verifySizes( args... );
98 return ranges::view::const_( ranges::view::zip( std::forward<Args>( args )... ) );
99 }
gaudirun.args
args
Definition: gaudirun.py:244
Gaudi::Functional::details::zip::verifySizes
decltype(auto) verifySizes(Args &...args)
Verify the data container sizes have the same sizes.
Definition: FunctionalDetails.h:73
template<typename OS , typename Arg >

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

Print the parameter.

Definition at line 36 of file FunctionalDetails.h.

37 {
38 out << "SizeOf'" << System::typeinfoName( typeid( Arg ) ) << "'=" << std::forward<Arg>( arg ).size();
39 }
System::typeinfoName
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:329
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 43 of file FunctionalDetails.h.

44 {
45 printSizes( out, arg );
46 out << ", ";
47 printSizes( out, args... );
48 }
gaudirun.args
args
Definition: gaudirun.py:244
Gaudi::Functional::details::zip::printSizes
void printSizes(OS &out, Arg &&arg, Args &&...args)
Print the parameters.
Definition: FunctionalDetails.h:43
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 85 of file FunctionalDetails.h.

86 {
87 // assert( check_sizes( args... ) );
88 verifySizes( args... );
89 return ranges::view::zip( std::forward<Args>( args )... );
90 }
gaudirun.args
args
Definition: gaudirun.py:244
Gaudi::Functional::details::zip::verifySizes
decltype(auto) verifySizes(Args &...args)
Verify the data container sizes have the same sizes.
Definition: FunctionalDetails.h:73
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 73 of file FunctionalDetails.h.

74 {
75 if ( UNLIKELY( !check_sizes( args... ) ) ) {
76 std::ostringstream mess;
77 mess << "Zipped containers have different sizes : ";
78 printSizes( mess, args... );
79 throw GaudiException( mess.str(), "Gaudi::Functional::details::zip::verifySizes", StatusCode::FAILURE );
80 }
81 }
UNLIKELY
#define UNLIKELY(x)
Definition: Kernel.h:128
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:22
StatusCode::FAILURE
Definition: StatusCode.h:31
gaudirun.args
args
Definition: gaudirun.py:244
Gaudi::Functional::details::zip::printSizes
void printSizes(OS &out, Arg &&arg, Args &&...args)
Print the parameters.
Definition: FunctionalDetails.h:43
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:66
std::ostringstream
STL class.
std::ostringstream::str
T str(T...args)