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

Classes

class  is_inlet_primitive
 A type trait for checking if a type is isomorphic to an Inlet primitive. More...
 
struct  is_inlet_primitive_array
 
struct  is_inlet_primitive_array< std::unordered_map< int, T > >
 
struct  is_inlet_array
 
struct  is_inlet_array< std::unordered_map< int, T > >
 
struct  is_std_function
 
struct  is_std_function< std::function< T > >
 
struct  std_function_signature
 
struct  std_function_signature< std::function< FuncType > >
 
struct  is_inlet_dict
 
struct  is_inlet_dict< std::unordered_map< std::string, T > >
 
struct  is_inlet_dict< std::unordered_map< VariantKey, T > >
 
struct  is_inlet_primitive_dict
 
struct  is_inlet_primitive_dict< std::unordered_map< std::string, T > >
 
struct  is_inlet_primitive_dict< std::unordered_map< VariantKey, T > >
 
struct  is_std_vector
 
struct  is_std_vector< std::vector< T > >
 
struct  is_primitive_std_vector
 
struct  is_primitive_std_vector< std::vector< T > >
 
class  has_FromInlet_specialization
 A type trait for checking if a type has specialized FromInlet with the required T operator()(axom::inlet::Container&) More...
 
struct  has_FromInlet_specialization< T, typename std::enable_if< std::is_same< T, decltype(std::declval< FromInlet< T > & >()(std::declval< const Container & >()))>::value >::type >
 
class  inlet_function_arg_type
 A type trait for modifying function argument types to enforce const correctness and to avoid copies. More...
 
class  cleanup_function_signature
 Takes a Ret(Args...) signature and applies cvref qualifiers to applicable arguments. More...
 
struct  cleanup_function_signature< Ret(Args...)>
 
struct  FunctionBuffer
 

Functions

std::string indexToString (const std::string &idx)
 An overloaded utility function for converting a type to a string. More...
 
std::string indexToString (const int idx)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
std::string indexToString (const VariantKey &idx)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
template<typename Result , typename From >
Result toIndex (const From &idx)
 An templated utility function for converting an index to the desired type. More...
 
template<>
int toIndex (const std::string &idx)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
template<typename Key >
bool matchesKeyType (const VariantKey &key)
 Determines whether a variant key is convertible to another type. More...
 
std::vector< VariantKeycollectionIndices (const Container &container, bool trimAbsolute=true)
 This is an internal utility intended to be used with arrays/dicts of user-defined types that returns the indices as strings - integer indices will be converted to strings. More...
 
std::vector< std::pair< std::string, std::string > > collectionIndicesWithPaths (const Container &container, const std::string &name)
 This is an internal utility intended to be used with arrays of user-defined types that returns the a list of pairs, each of which contain an index (a number) and a fully qualified path within the input file to the array element at the corresponding index. More...
 
void updateUnexpectedNames (const std::string &accessedName, std::vector< std::string > &unexpectedNames)
 Updates the set of unexpected names to reflect an user-requested access. More...
 
template<typename Func >
void destroy_func_inst (FunctionBuffer *function_storage)
 
template<>
void destroy_func_inst< void > (FunctionBuffer *)
 

Variables

static constexpr std::size_t MAX_NUM_ARGS = 2u
 
const std::string COLLECTION_GROUP_NAME = "_inlet_collection"
 
const std::string COLLECTION_INDICES_NAME = "_inlet_collection_indices"
 
const std::string STRUCT_COLLECTION_FLAG = "_inlet_struct_collection"
 
const std::string REQUIRED_FLAG = "required"
 
const std::string STRICT_FLAG = "strict"
 

Function Documentation

◆ indexToString() [1/3]

std::string axom::inlet::detail::indexToString ( const std::string &  idx)
inline

An overloaded utility function for converting a type to a string.

Note
Needed as std::to_string doesn't implement an identity overload
Parameters
[in]idxThe index to convert to string

◆ indexToString() [2/3]

std::string axom::inlet::detail::indexToString ( const int  idx)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ indexToString() [3/3]

std::string axom::inlet::detail::indexToString ( const VariantKey idx)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

References indexToString(), axom::inlet::String, and axom::inlet::VariantKey::type().

◆ toIndex() [1/2]

template<typename Result , typename From >
Result axom::inlet::detail::toIndex ( const From &  idx)
inline

An templated utility function for converting an index to the desired type.

Parameters
[in]idxThe index to convert
Template Parameters
FromThe type of the idx parameter (converting from)
ResultThe type to convert to

◆ toIndex() [2/2]

template<>
int axom::inlet::detail::toIndex ( const std::string &  idx)
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

References SLIC_ERROR_IF.

◆ matchesKeyType()

template<typename Key >
bool axom::inlet::detail::matchesKeyType ( const VariantKey key)

Determines whether a variant key is convertible to another type.

Template Parameters
KeyThe type to check the validity of the conversion to
Note
That is, returns true if the key holds an integer and Key is int, etc

References axom::inlet::Integer, axom::inlet::String, and axom::inlet::VariantKey::type().

◆ collectionIndices()

std::vector<VariantKey> axom::inlet::detail::collectionIndices ( const Container container,
bool  trimAbsolute = true 
)

This is an internal utility intended to be used with arrays/dicts of user-defined types that returns the indices as strings - integer indices will be converted to strings.

Parameters
[in]containerThe container to retrieve indices from
[in]trimAbsoluteWhether to only return the "basename" if the path is absolute, e.g., an absolute path foo/0/bar will be trimmed to "bar"

◆ collectionIndicesWithPaths()

std::vector<std::pair<std::string, std::string> > axom::inlet::detail::collectionIndicesWithPaths ( const Container container,
const std::string &  name 
)

This is an internal utility intended to be used with arrays of user-defined types that returns the a list of pairs, each of which contain an index (a number) and a fully qualified path within the input file to the array element at the corresponding index.

Parameters
[in]containerThe container to retrieve indices from
[in]nameThe name of the array object in the input file

◆ updateUnexpectedNames()

void axom::inlet::detail::updateUnexpectedNames ( const std::string &  accessedName,
std::vector< std::string > &  unexpectedNames 
)

Updates the set of unexpected names to reflect an user-requested access.

Parameters
[in]accessedNameThe path within the input file that will be accessed
[in,out]unexpectedNamesThe set of input file paths that have not yet been requested by the user
Note
To maintain consistency, this function should always be followed by an access to a Reader

◆ destroy_func_inst()

template<typename Func >
void axom::inlet::detail::destroy_func_inst ( FunctionBuffer function_storage)
inline

◆ destroy_func_inst< void >()

template<>
void axom::inlet::detail::destroy_func_inst< void > ( FunctionBuffer )
inline

Variable Documentation

◆ MAX_NUM_ARGS

constexpr std::size_t axom::inlet::detail::MAX_NUM_ARGS = 2u
staticconstexpr

◆ COLLECTION_GROUP_NAME

const std::string axom::inlet::detail::COLLECTION_GROUP_NAME = "_inlet_collection"

Names of the internal collection data and collection index groups/fields used for managing arrays/dictionaries

◆ COLLECTION_INDICES_NAME

const std::string axom::inlet::detail::COLLECTION_INDICES_NAME = "_inlet_collection_indices"

◆ STRUCT_COLLECTION_FLAG

const std::string axom::inlet::detail::STRUCT_COLLECTION_FLAG = "_inlet_struct_collection"

◆ REQUIRED_FLAG

const std::string axom::inlet::detail::REQUIRED_FLAG = "required"

◆ STRICT_FLAG

const std::string axom::inlet::detail::STRICT_FLAG = "strict"