A sum type for callables with arbitrary signature.
More...
#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/latest/src/axom/inlet/Function.hpp>
|
template<typename FuncType > |
| FunctionWrapper (std::function< FuncType > &&func) |
| Primary constructor, initializes a member of the "variant". More...
|
|
| FunctionWrapper ()=default |
|
template<typename Ret , typename... Args> |
Ret | call (Args &&... args) const |
| Calls the function. More...
|
|
template<typename FuncType > |
std::function< FuncType > | get () const |
|
| operator bool () const |
| Checks whether the function exists. More...
|
|
void | setName (std::string &&name) |
| Sets the function's name. More...
|
|
A sum type for callables with arbitrary signature.
- Template Parameters
-
FunctionTags | The types of supported functions |
This provides an interface not templated on a specific function signature for uniform retrieval through the Reader interface
◆ FunctionWrapper() [1/2]
template<typename FuncType >
axom::inlet::FunctionWrapper::FunctionWrapper |
( |
std::function< FuncType > && |
func | ) |
|
|
inline |
◆ FunctionWrapper() [2/2]
axom::inlet::FunctionWrapper::FunctionWrapper |
( |
| ) |
|
|
default |
◆ call()
template<typename Ret , typename... Args>
Ret axom::inlet::FunctionWrapper::call |
( |
Args &&... |
args | ) |
const |
|
inline |
Calls the function.
- Parameters
-
[in] | args | The parameter pack for the function's arguments |
- Template Parameters
-
Ret | The user-specified return type, needed to fully disambiguate the function to call |
Args | The types of the user-specified arguments, deduced automatically |
- Returns
- The function's result
References SLIC_ERROR_IF.
◆ get()
template<typename FuncType >
std::function<FuncType> axom::inlet::FunctionWrapper::get |
( |
| ) |
const |
|
inline |
◆ operator bool()
axom::inlet::FunctionWrapper::operator bool |
( |
| ) |
const |
|
inlineexplicit |
Checks whether the function exists.
◆ setName()
void axom::inlet::FunctionWrapper::setName |
( |
std::string && |
name | ) |
|
|
inline |
Sets the function's name.
- Note
- Needs to be separate from constructor to allow the compiler to deduce template arguments correctly
The documentation for this class was generated from the following file:
- /home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/latest/src/axom/inlet/Function.hpp