AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
axom::inlet::Function Class Reference

#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/latest/src/axom/inlet/Function.hpp>

Inheritance diagram for axom::inlet::Function:

Public Types

using Verifier = std::function< bool(const Function &, std::vector< VerificationError > *errors)>
 

Public Member Functions

 Function (axom::sidre::Group *sidreGroup, axom::sidre::Group *root, FunctionVariant &&func)
 
template<typename FuncType >
std::function< FuncType > get () const
 Returns a function of requested type. More...
 
template<typename Ret , typename... Args>
Ret call (Args &&... args) const
 
const axom::sidre::GroupsidreGroup () const
 Returns pointer to the Sidre Group class for this Function. More...
 
 operator bool () const
 Checks whether the function exists. More...
 
std::string name () const
 
bool verify (std::vector< VerificationError > *errors=nullptr) const override
 Verifies the object to make sure it satisfies the imposed requirements. More...
 
Functionrequired (bool isRequired=true) override
 Set the required status of this object. More...
 
bool isRequired () const override
 Return the required status. More...
 
FunctionregisterVerifier (Verifier lambda) override
 Registers the function object that will verify this object's contents during the verification stage. More...
 
Verifiable< Function > & registerVerifier (std::function< bool(const Function &)> verifier)
 Registers the function object that will verify this object's contents during the verification stage. More...
 

Member Typedef Documentation

◆ Verifier

using axom::inlet::Verifiable< Function >::Verifier = std::function<bool(const Function &, std::vector<VerificationError>* errors)>
inherited

A function which can verify the contents of the item being verifier. It should report any errors via INLET_VERIFICATION_WARNING, passing in the given array of errors.

Constructor & Destructor Documentation

◆ Function()

axom::inlet::Function::Function ( axom::sidre::Group sidreGroup,
axom::sidre::Group root,
FunctionVariant &&  func 
)
inline

Member Function Documentation

◆ get()

template<typename FuncType >
std::function<FuncType> axom::inlet::Function::get ( ) const
inline

Returns a function of requested type.

Returns
The value
Template Parameters
TThe type to retrieve

References axom::inlet::FunctionWrapper::get().

◆ call()

template<typename Ret , typename... Args>
Ret axom::inlet::Function::call ( Args &&...  args) const
inline

◆ sidreGroup()

const axom::sidre::Group* axom::inlet::Function::sidreGroup ( ) const
inline

Returns pointer to the Sidre Group class for this Function.

Provides access to the Sidre Group class that holds all the stored information for this Function instance.

◆ operator bool()

axom::inlet::Function::operator bool ( ) const
inline

Checks whether the function exists.

◆ name()

std::string axom::inlet::Function::name ( ) const
Returns
The full name for this Function.

◆ verify()

bool axom::inlet::Function::verify ( std::vector< VerificationError > *  errors = nullptr) const
overridevirtual

Verifies the object to make sure it satisfies the imposed requirements.

Parameters
[in]errorsAn optional vector of errors to append to in the case of verification failure

Ownership is not taken of errors, the raw pointer is only used for its optional reference semantics, as opposed to something like std::optional<std::reference_wrapper<T>>

Implements axom::inlet::Verifiable< Function >.

◆ required()

Function& axom::inlet::Function::required ( bool  isRequired = true)
overridevirtual

Set the required status of this object.

Set whether this object is required, or not, to be in the input file. The default behavior is to not be required.

Parameters
[in]isRequiredBoolean value of whether object is required
Returns
Reference to calling object, for chaining

Implements axom::inlet::Verifiable< Function >.

◆ isRequired()

bool axom::inlet::Function::isRequired ( ) const
overridevirtual

Return the required status.

Return that this object is required, or not, to be in the input file. The default behavior is to not be required.

Returns
Boolean value of whether this object is required

Implements axom::inlet::Verifiable< Function >.

◆ registerVerifier() [1/2]

Function& axom::inlet::Function::registerVerifier ( Verifier  verifier)
overridevirtual

Registers the function object that will verify this object's contents during the verification stage.

Parameters
[in]verifierThe function which will verify the contents of the container.

Implements axom::inlet::Verifiable< Function >.

◆ registerVerifier() [2/2]

Verifiable<Function >& axom::inlet::Verifiable< Function >::registerVerifier ( std::function< bool(const Function &)>  verifier)
inlineinherited

Registers the function object that will verify this object's contents during the verification stage.

Parameters
[in]verifierThe function object.

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