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

#include <TupleAs.h>

Public Types

using default_type = T
 
using via_type = typename OptionalTuple< ARGS... >::value_type
 
using value_type = T
 
using ftype = typename OptionalTuple< ARGS... >::ftype
 

Public Member Functions

 TupleAs (Name &&name)
 
 TupleAs (Name &&name, Comment &&comment)
 
 TupleAs (Name &&name, Comment &&comment, std::function< bool()> maybeUse)
 
 TupleAs (Name &&name, T const &t)
 
 TupleAs (Name &&name, Comment &&comment, T const &t)
 
 TupleAs (Name &&name, Comment &&comment, std::function< bool()> maybeUse, T const &t)
 
operator() () const
 
 operator detail::ParameterBase & ()
 

Private Member Functions

Comment conversion_comment (Comment &&comment) const
 
Comment conversion_comment (Comment &&comment, T const &t) const
 

Private Attributes

OptionalTuple< ARGS... > tupleObj_
 
std::shared_ptr< T > t_ {}
 

Detailed Description

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

Definition at line 26 of file TupleAs.h.

Member Typedef Documentation

template<typename T , typename... ARGS>
using fhicl::TupleAs< T(ARGS...)>::default_type = T

Definition at line 28 of file TupleAs.h.

template<typename T , typename... ARGS>
using fhicl::TupleAs< T(ARGS...)>::ftype = typename OptionalTuple<ARGS...>::ftype

Definition at line 31 of file TupleAs.h.

template<typename T , typename... ARGS>
using fhicl::TupleAs< T(ARGS...)>::value_type = T

Definition at line 30 of file TupleAs.h.

template<typename T , typename... ARGS>
using fhicl::TupleAs< T(ARGS...)>::via_type = typename OptionalTuple<ARGS...>::value_type

Definition at line 29 of file TupleAs.h.

Constructor & Destructor Documentation

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

Definition at line 80 of file TupleAs.h.

81  : TupleAs{std::move(name), Comment("")}
82  {}
static QCString name
Definition: declinfo.cpp:673
TupleAs(Name &&name)
Definition: TupleAs.h:80
def move(depos, offset)
Definition: depos.py:107
#define Comment
template<typename T , typename... ARGS>
fhicl::TupleAs< T(ARGS...)>::TupleAs ( Name &&  name,
Comment &&  comment 
)
explicit

Definition at line 85 of file TupleAs.h.

87  {
89  }
static QCString name
Definition: declinfo.cpp:673
Comment conversion_comment(Comment &&comment) const
Definition: TupleAs.h:131
int comment
def move(depos, offset)
Definition: depos.py:107
void set_par_style(par_style const vt)
OptionalTuple< ARGS... > tupleObj_
Definition: TupleAs.h:68
template<typename T , typename... ARGS>
fhicl::TupleAs< T(ARGS...)>::TupleAs ( Name &&  name,
Comment &&  comment,
std::function< bool()>  maybeUse 
)
explicit

Definition at line 92 of file TupleAs.h.

97  maybeUse}
98  {
100  }
static QCString name
Definition: declinfo.cpp:673
Comment conversion_comment(Comment &&comment) const
Definition: TupleAs.h:131
int comment
def move(depos, offset)
Definition: depos.py:107
void set_par_style(par_style const vt)
OptionalTuple< ARGS... > tupleObj_
Definition: TupleAs.h:68
template<typename T , typename... ARGS>
fhicl::TupleAs< T(ARGS...)>::TupleAs ( Name &&  name,
T const &  t 
)
explicit

Definition at line 104 of file TupleAs.h.

105  : TupleAs{std::move(name), Comment(""), t}
106  {}
static QCString name
Definition: declinfo.cpp:673
TupleAs(Name &&name)
Definition: TupleAs.h:80
def move(depos, offset)
Definition: depos.py:107
#define Comment
template<typename T , typename... ARGS>
fhicl::TupleAs< T(ARGS...)>::TupleAs ( Name &&  name,
Comment &&  comment,
T const &  t 
)
explicit

Definition at line 109 of file TupleAs.h.

111  , t_{std::make_shared<T>(t)}
112  {
114  }
static QCString name
Definition: declinfo.cpp:673
Comment conversion_comment(Comment &&comment) const
Definition: TupleAs.h:131
int comment
std::shared_ptr< T > t_
Definition: TupleAs.h:70
def move(depos, offset)
Definition: depos.py:107
void set_par_style(par_style const vt)
OptionalTuple< ARGS... > tupleObj_
Definition: TupleAs.h:68
template<typename T , typename... ARGS>
fhicl::TupleAs< T(ARGS...)>::TupleAs ( Name &&  name,
Comment &&  comment,
std::function< bool()>  maybeUse,
T const &  t 
)
explicit

Definition at line 117 of file TupleAs.h.

123  maybeUse}
124  , t_{std::make_shared<T>(t)}
125  {
127  }
static QCString name
Definition: declinfo.cpp:673
Comment conversion_comment(Comment &&comment) const
Definition: TupleAs.h:131
int comment
std::shared_ptr< T > t_
Definition: TupleAs.h:70
def move(depos, offset)
Definition: depos.py:107
void set_par_style(par_style const vt)
OptionalTuple< ARGS... > tupleObj_
Definition: TupleAs.h:68

Member Function Documentation

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

Definition at line 131 of file TupleAs.h.

132  {
133  std::string const preface =
134  "N.B. The following sequence is converted to type:";
135  std::string const name =
136  " '" + cet::demangle_symbol(typeid(T).name()) + "'";
137  std::string const user_comment =
138  comment.value.empty() ? "" : "\n\n" + comment.value;
139 
140  std::ostringstream oss;
141  oss << preface << '\n' << name << user_comment;
142  return Comment{oss.str().c_str()};
143  }
static QCString name
Definition: declinfo.cpp:673
std::string string
Definition: nybbler.cc:12
int comment
#define Comment
template<typename T , typename... ARGS>
Comment fhicl::TupleAs< T(ARGS...)>::conversion_comment ( Comment &&  comment,
T const &  t 
) const
private

Definition at line 202 of file TupleAs.h.

203  {
204  std::string const preface{
205  "N.B. The following sequence is converted to type:"};
206  std::string const name{" '" +
207  cet::demangle_symbol(typeid(T).name()) + "'"};
208 
210  stringified_default;
211 
212  std::string const user_comment{
213  comment.value.empty() ? "" : "\n\n" + comment.value};
214 
215  std::ostringstream oss;
216  oss << preface << '\n'
217  << name << '\n'
218  << stringified_default(t) << user_comment;
219  return Comment{oss.str().c_str()};
220  }
static QCString name
Definition: declinfo.cpp:673
std::string string
Definition: nybbler.cc:12
int comment
#define Comment
template<typename T , typename... ARGS>
fhicl::TupleAs< T(ARGS...)>::operator detail::ParameterBase & ( )
inline

Definition at line 61 of file TupleAs.h.

62  {
63  return tupleObj_;
64  } // Allows implicit conversion from
OptionalTuple< ARGS... > tupleObj_
Definition: TupleAs.h:68
template<typename T , typename... ARGS>
T fhicl::TupleAs< T(ARGS...)>::operator() ( ) const
inline

Definition at line 48 of file TupleAs.h.

49  {
50  via_type via;
51  return tupleObj_(via) ? std::make_from_tuple<T>(via) :
53  *t_ :
54  throw fhicl::exception(
55  cant_find); // fix this exception category!
56  }
std::shared_ptr< T > t_
Definition: TupleAs.h:70
typename OptionalTuple< ARGS... >::value_type via_type
Definition: TupleAs.h:29
OptionalTuple< ARGS... > tupleObj_
Definition: TupleAs.h:68
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33

Member Data Documentation

template<typename T , typename... ARGS>
std::shared_ptr<T> fhicl::TupleAs< T(ARGS...)>::t_ {}
private

Definition at line 70 of file TupleAs.h.

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

Definition at line 68 of file TupleAs.h.


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