WireCellToolkit
Wire Cell Simulation, Signal Process and Reconstruction Toolki for Liquid Argon Detectors
WireCell::tuple_helper< T< Types... > > Struct Template Reference

#include <TupleHelpers.h>

Classes

struct  Wrapped
 
struct  WrappedConst
 

Public Types

typedef T< Types... > tuple_type
 
typedef std::vector< boost::any > any_vector_type
 

Public Member Functions

std::vector< std::string > type_names ()
 
template<std::size_t... Indices>
any_vector_type as_any_impl (const tuple_type &t, std::index_sequence< Indices... >)
 
any_vector_type as_any (const tuple_type &t)
 
template<std::size_t... Indices>
tuple_type from_any_impl (const any_vector_type &anyv, std::index_sequence< Indices... >)
 
tuple_type from_any (const any_vector_type &anyv)
 

Detailed Description

template<template< typename... > class T, typename... Types>
struct WireCell::tuple_helper< T< Types... > >

Definition at line 64 of file TupleHelpers.h.

Member Typedef Documentation

◆ any_vector_type

template<template< typename... > class T, typename... Types>
typedef std::vector<boost::any> WireCell::tuple_helper< T< Types... > >::any_vector_type

Definition at line 79 of file TupleHelpers.h.

◆ tuple_type

template<template< typename... > class T, typename... Types>
typedef T<Types...> WireCell::tuple_helper< T< Types... > >::tuple_type

Definition at line 66 of file TupleHelpers.h.

Member Function Documentation

◆ as_any()

template<template< typename... > class T, typename... Types>
any_vector_type WireCell::tuple_helper< T< Types... > >::as_any ( const tuple_type t)
inline

Convert a tuple of types to a vector of boost::any.

IFDCS ifdcs{1,2.2f,3.0e-9,'a',"foo"}; std::vector<boost::any> anyvec = helper.as_any(ifdcs);

Definition at line 101 of file TupleHelpers.h.

◆ as_any_impl()

template<template< typename... > class T, typename... Types>
template<std::size_t... Indices>
any_vector_type WireCell::tuple_helper< T< Types... > >::as_any_impl ( const tuple_type t,
std::index_sequence< Indices... >   
)
inline

Definition at line 92 of file TupleHelpers.h.

◆ from_any()

template<template< typename... > class T, typename... Types>
tuple_type WireCell::tuple_helper< T< Types... > >::from_any ( const any_vector_type anyv)
inline

Return a tuple made from the contents of an equivalent vector of boost::any

// anyvec is from above example IFDCS t = helper.from_any(anyvec);

Definition at line 117 of file TupleHelpers.h.

◆ from_any_impl()

template<template< typename... > class T, typename... Types>
template<std::size_t... Indices>
tuple_type WireCell::tuple_helper< T< Types... > >::from_any_impl ( const any_vector_type anyv,
std::index_sequence< Indices... >   
)
inline

Definition at line 108 of file TupleHelpers.h.

◆ type_names()

template<template< typename... > class T, typename... Types>
std::vector<std::string> WireCell::tuple_helper< T< Types... > >::type_names ( )
inline

Compile-time mapping of methods on tuple element types

std::vector<std::string> typenames = helper.type_names();

Definition at line 86 of file TupleHelpers.h.


The documentation for this struct was generated from the following file: