Public Member Functions | Private Member Functions | Private Attributes | List of all members
fhicl::OptionalTupleAs< T(ARGS...)> Class Template Reference

#include "/cvmfs/nova.opensciencegrid.org/externals/fhiclcpp/v4_06_10/source/fhiclcpp/types/OptionalTupleAs.h"

Public Member Functions

 OptionalTupleAs (Name &&name)
 
 OptionalTupleAs (Name &&name, Comment &&comment)
 
 OptionalTupleAs (Name &&name, Comment &&comment, std::function< bool()> maybeUse)
 
template<std::size_t... I>
T fill (typename OptionalTuple< ARGS... >::value_type const &via, std::index_sequence< I... >) const
 
bool operator() (T &result) const
 
bool hasValue () const
 

Private Member Functions

Comment conversion_comment (Comment &&comment) const
 

Private Attributes

OptionalTuple< ARGS... > tupleObj_
 

Detailed Description

template<typename T, typename... ARGS>
class fhicl::OptionalTupleAs< T(ARGS...)>

Definition at line 24 of file OptionalTupleAs.h.

Constructor & Destructor Documentation

template<typename T , typename... ARGS>
fhicl::OptionalTupleAs< T(ARGS...)>::OptionalTupleAs ( Name &&  name)
explicit

Definition at line 82 of file OptionalTupleAs.h.

References T.

83  : OptionalTupleAs{std::move(name), Comment("")}
84  {}
const XML_Char * name
Definition: expat.h:151
template<typename T , typename... ARGS>
fhicl::OptionalTupleAs< T(ARGS...)>::OptionalTupleAs ( Name &&  name,
Comment &&  comment 
)
explicit

Definition at line 87 of file OptionalTupleAs.h.

References T.

88  : tupleObj_{std::move(name), conversion_comment(std::move(comment))}
89  {}
const XML_Char * name
Definition: expat.h:151
Comment conversion_comment(Comment &&comment) const
OptionalTuple< ARGS... > tupleObj_
template<typename T , typename... ARGS>
fhicl::OptionalTupleAs< T(ARGS...)>::OptionalTupleAs ( Name &&  name,
Comment &&  comment,
std::function< bool()>  maybeUse 
)
explicit

Definition at line 92 of file OptionalTupleAs.h.

95  : tupleObj_{std::move(name),
96  conversion_comment(std::move(comment)),
97  maybeUse}
98  {}
const XML_Char * name
Definition: expat.h:151
Comment conversion_comment(Comment &&comment) const
OptionalTuple< ARGS... > tupleObj_

Member Function Documentation

template<typename T , typename... ARGS>
Comment fhicl::OptionalTupleAs< T(ARGS...)>::conversion_comment ( Comment &&  comment) const
inlineprivate

Definition at line 62 of file OptionalTupleAs.h.

References string, and T.

63  {
64  std::string const preface =
65  "N.B. The following sequence is converted to type:";
66  std::string const name =
67  " '" + cet::demangle_symbol(typeid(T).name()) + "'";
68  std::string const user_comment =
69  comment.value.empty() ? "" : "\n\n" + comment.value;
70 
71  std::ostringstream oss;
72  oss << preface << '\n' << name << user_comment;
73 
74  return Comment{oss.str().c_str()};
75  }
const XML_Char * name
Definition: expat.h:151
double T
Definition: Xdiff_gwt.C:5
enum BeamMode string
template<typename T , typename... ARGS>
template<std::size_t... I>
T fhicl::OptionalTupleAs< T(ARGS...)>::fill ( typename OptionalTuple< ARGS... >::value_type const &  via,
std::index_sequence< I... >   
) const
inline

Definition at line 34 of file OptionalTupleAs.h.

36  {
37  return T{std::get<I>(via)...};
38  }
double T
Definition: Xdiff_gwt.C:5
template<typename T , typename... ARGS>
bool fhicl::OptionalTupleAs< T(ARGS...)>::hasValue ( ) const
inline

Definition at line 53 of file OptionalTupleAs.h.

54  {
55  return tupleObj_.hasValue();
56  }
OptionalTuple< ARGS... > tupleObj_
bool hasValue() const
Definition: OptionalTuple.h:42
template<typename T , typename... ARGS>
bool fhicl::OptionalTupleAs< T(ARGS...)>::operator() ( T result) const
inline

Definition at line 41 of file OptionalTupleAs.h.

References stan::math::fill(), std::swap(), and tmp.

42  {
43  typename OptionalTuple<ARGS...>::value_type via;
44  if (tupleObj_(via)) {
45  auto tmp = fill(via, std::index_sequence_for<ARGS...>{});
47  return true;
48  }
49  return false;
50  }
Float_t tmp
Definition: plot.C:36
void swap(art::HLTGlobalStatus &lhs, art::HLTGlobalStatus &rhs)
OptionalTuple< ARGS... > tupleObj_
T fill(typename OptionalTuple< ARGS... >::value_type const &via, std::index_sequence< I... >) const

Member Data Documentation

template<typename T , typename... ARGS>
OptionalTuple<ARGS...> fhicl::OptionalTupleAs< T(ARGS...)>::tupleObj_
private

Definition at line 59 of file OptionalTupleAs.h.


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