Classes | Public Types | Public Member Functions | List of all members
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::stringtype_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

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.

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

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.

101  {
103  }
any_vector_type as_any_impl(const tuple_type &t, std::index_sequence< Indices... >)
Definition: TupleHelpers.h:92
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1225
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.

92  {
93  return { boost::any(std::get<Indices>(t))... };
94  }
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.

117  {
119  }
tuple_type from_any_impl(const any_vector_type &anyv, std::index_sequence< Indices... >)
Definition: TupleHelpers.h:108
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1225
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.

108  {
109  return std::make_tuple(boost::any_cast<Types>(anyv[Indices])...);
110  }
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.

86  {
87  return { std::string(typeid(Types).name())... };
88  }
static QCString name
Definition: declinfo.cpp:673
std::string string
Definition: nybbler.cc:12

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