Provides a uniform interface for access and conversion to primitive and user-defined types.
More...
#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/latest/src/axom/inlet/Proxy.hpp>
|
| Proxy ()=default |
|
| Proxy (const Container &container) |
| Constructs a proxy view onto a container. More...
|
|
| Proxy (const Field &field) |
| Constructs a proxy view onto a field. More...
|
|
| Proxy (const Function &func) |
| Constructs a proxy view onto a function. More...
|
|
template<typename T , typename SFINAE = typename std::enable_if< detail::is_inlet_primitive<T>::value || detail::is_inlet_primitive_array<T>::value || detail::is_inlet_primitive_dict<T>::value || detail::is_std_function<T>::value || detail::is_primitive_std_vector<T>::value>::type> |
| operator T () const |
| Returns an object from the proxy. More...
|
|
bool | contains (const std::string &name) const |
| Return whether a subobject with the given name is present in the container referred to by the calling proxy. More...
|
|
InletType | type () const |
| Returns the type of the stored value. More...
|
|
Proxy | operator[] (const std::string &name) const |
| Obtains a proxy view into the proxy for either a Field/Container subobject. More...
|
|
const axom::sidre::Group * | sidreGroup () const |
| Returns pointer to the Sidre Group for the underlying object. More...
|
|
std::string | name () const |
|
template<typename T > |
std::enable_if<!detail::is_inlet_primitive< T >::value &&!detail::is_std_function< T >::value, T >::type | get () const |
| Returns a user-defined type from the proxy. More...
|
|
template<typename T > |
std::enable_if< detail::is_std_function< T >::value, T >::type | get () const |
| Returns a function type from the proxy. More...
|
|
template<typename Ret , typename... Args> |
Ret | call (Args &&... args) const |
| Calls the function. More...
|
|
template<typename T > |
std::enable_if< detail::is_inlet_primitive< T >::value, T >::type | get () const |
| Returns a primitive type from the proxy. More...
|
|
Provides a uniform interface for access and conversion to primitive and user-defined types.
- See also
- Inlet Field
-
Inlet Container
◆ Proxy() [1/4]
axom::inlet::Proxy::Proxy |
( |
| ) |
|
|
default |
◆ Proxy() [2/4]
axom::inlet::Proxy::Proxy |
( |
const Container & |
container | ) |
|
|
inline |
Constructs a proxy view onto a container.
- Parameters
-
[in] | container | The container to construct a proxy into |
◆ Proxy() [3/4]
axom::inlet::Proxy::Proxy |
( |
const Field & |
field | ) |
|
|
inline |
Constructs a proxy view onto a field.
- Parameters
-
[in] | field | The field to construct a proxy into |
◆ Proxy() [4/4]
axom::inlet::Proxy::Proxy |
( |
const Function & |
func | ) |
|
|
inline |
Constructs a proxy view onto a function.
- Parameters
-
[in] | func | The function to construct a proxy into |
◆ operator T()
template<typename T , typename SFINAE = typename std::enable_if< detail::is_inlet_primitive<T>::value || detail::is_inlet_primitive_array<T>::value || detail::is_inlet_primitive_dict<T>::value || detail::is_std_function<T>::value || detail::is_primitive_std_vector<T>::value>::type>
axom::inlet::Proxy::operator T |
( |
| ) |
const |
|
inline |
Returns an object from the proxy.
- Template Parameters
-
T | The type of the object to retrieve |
- Returns
- The retrieved object
- Note
- Implicit conversions are defined only for primitive types - to convert to a user-defined type, use an explicit conversion with static_cast or T{}
◆ contains()
bool axom::inlet::Proxy::contains |
( |
const std::string & |
name | ) |
const |
Return whether a subobject with the given name is present in the container referred to by the calling proxy.
- Returns
- Boolean value indicating whether this Container's subtree contains a Field or Container with the given name.
◆ type()
Returns the type of the stored value.
- Returns
- The type
- See also
- InletType
◆ operator[]()
Proxy axom::inlet::Proxy::operator[] |
( |
const std::string & |
name | ) |
const |
Obtains a proxy view into the proxy for either a Field/Container subobject.
Returns a reference via a lightweight proxy object to the element in the datastore at the index specified by the name. This can be a field or a container.
- Parameters
-
[in] | name | The name of the subobject |
- Returns
- A view onto the subobject
◆ sidreGroup()
Returns pointer to the Sidre Group for the underlying object.
Provides access to the Sidre Group class that holds all the stored information for the underlying object.
◆ name()
std::string axom::inlet::Proxy::name |
( |
| ) |
const |
- Returns
- The full name for the underlying object.
◆ get() [1/3]
Returns a user-defined type from the proxy.
- Template Parameters
-
T | The type of the object to retrieve |
- Returns
- The retrieved object
- Precondition
- The Proxy must refer to a container object
References axom::inlet::Container::get(), and SLIC_ASSERT_MSG.
◆ get() [2/3]
◆ call()
template<typename Ret , typename... Args>
Ret axom::inlet::Proxy::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 axom::inlet::Function::call(), and SLIC_ASSERT_MSG.
◆ get() [3/3]
Returns a primitive type from the proxy.
- Template Parameters
-
T | The type of the object to retrieve |
- Returns
- The retrieved object
- Precondition
- The Proxy must refer to a field object
References axom::inlet::Field::get(), and SLIC_ASSERT_MSG.
The documentation for this class was generated from the following file:
- /home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/latest/src/axom/inlet/Proxy.hpp