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

#include <OptionalTupleAs.h>

Public Member Functions

 OptionalTupleAs (Name &&name)
 
 OptionalTupleAs (Name &&name, Comment &&comment)
 
 OptionalTupleAs (Name &&name, Comment &&comment, std::function< bool()> maybeUse)
 
std::optional< T > operator() () 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 25 of file OptionalTupleAs.h.

Constructor & Destructor Documentation

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

Definition at line 83 of file OptionalTupleAs.h.

85  {}
static QCString name
Definition: declinfo.cpp:673
def move(depos, offset)
Definition: depos.py:107
#define Comment
template<typename T , typename... ARGS>
fhicl::OptionalTupleAs< T(ARGS...)>::OptionalTupleAs ( Name &&  name,
Comment &&  comment 
)
explicit

Definition at line 88 of file OptionalTupleAs.h.

90  {}
static QCString name
Definition: declinfo.cpp:673
Comment conversion_comment(Comment &&comment) const
int comment
def move(depos, offset)
Definition: depos.py:107
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 93 of file OptionalTupleAs.h.

98  maybeUse}
99  {}
static QCString name
Definition: declinfo.cpp:673
Comment conversion_comment(Comment &&comment) const
int comment
def move(depos, offset)
Definition: depos.py:107
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 63 of file OptionalTupleAs.h.

64  {
65  std::string const preface =
66  "N.B. The following sequence is converted to type:";
67  std::string const name =
68  " '" + cet::demangle_symbol(typeid(T).name()) + "'";
69  std::string const user_comment =
70  comment.value.empty() ? "" : "\n\n" + comment.value;
71 
72  std::ostringstream oss;
73  oss << preface << '\n' << name << user_comment;
74 
75  return Comment{oss.str().c_str()};
76  }
static QCString name
Definition: declinfo.cpp:673
std::string string
Definition: nybbler.cc:12
int comment
#define Comment
template<typename T , typename... ARGS>
bool fhicl::OptionalTupleAs< T(ARGS...)>::hasValue ( ) const
inline

Definition at line 54 of file OptionalTupleAs.h.

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

Definition at line 34 of file OptionalTupleAs.h.

35  {
36  if (auto via = tupleObj_()) {
37  return make_optional(std::make_from_tuple(*via));
38  }
39  return std::nullopt;
40  }
OptionalTuple< ARGS... > tupleObj_
template<typename T , typename... ARGS>
bool fhicl::OptionalTupleAs< T(ARGS...)>::operator() ( T &  result) const
inline

Definition at line 44 of file OptionalTupleAs.h.

45  {
46  auto t = operator()();
47  if (t) {
48  result = *t;
49  }
50  return t.has_value();
51  }
static QCString result
std::optional< T > operator()() const

Member Data Documentation

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

Definition at line 60 of file OptionalTupleAs.h.


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