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

Provides a generic key type for mixed-key associative arrays/dictionaries. More...

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

Public Member Functions

 VariantKey (const int key)
 Parameterized constructors for initializing the variant. More...
 
 VariantKey (const std::string &key)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
 VariantKey (std::string &&key)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
 VariantKey (const char key[])
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
VariantKeyoperator= (const int key)
 Parameterized assignment operators for re-initializing the variant. More...
 
VariantKeyoperator= (const std::string &key)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
VariantKeyoperator= (std::string &&key)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
VariantKeyoperator= (const char key[])
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More...
 
 operator int () const
 Implicit conversion operators to make usage more convenient. More...
 
 operator const std::string & () const
 
InletType type () const
 Returns the type of the active member. More...
 
bool operator== (const VariantKey &other) const
 Comparison operator, returns true iff the active types are the same and the corresponding active members compare equal. More...
 

Detailed Description

Provides a generic key type for mixed-key associative arrays/dictionaries.

Note
Can be thought of as limited implementation of std::variant<int, std::string>

Constructor & Destructor Documentation

◆ VariantKey() [1/4]

axom::inlet::VariantKey::VariantKey ( const int  key)
inline

Parameterized constructors for initializing the variant.

Parameters
[in]keyThe key to initialize with

References axom::inlet::Integer.

◆ VariantKey() [2/4]

axom::inlet::VariantKey::VariantKey ( const std::string &  key)
inline

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

References axom::inlet::String.

◆ VariantKey() [3/4]

axom::inlet::VariantKey::VariantKey ( std::string &&  key)
inline

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

References axom::inlet::String.

◆ VariantKey() [4/4]

axom::inlet::VariantKey::VariantKey ( const char  key[])
inline

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

References axom::inlet::String.

Member Function Documentation

◆ operator=() [1/4]

VariantKey& axom::inlet::VariantKey::operator= ( const int  key)

Parameterized assignment operators for re-initializing the variant.

Parameters
[in]keyThe key to initialize with

◆ operator=() [2/4]

VariantKey& axom::inlet::VariantKey::operator= ( const std::string &  key)

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

◆ operator=() [3/4]

VariantKey& axom::inlet::VariantKey::operator= ( std::string &&  key)

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

◆ operator=() [4/4]

VariantKey& axom::inlet::VariantKey::operator= ( const char  key[])

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

◆ operator int()

axom::inlet::VariantKey::operator int ( ) const

Implicit conversion operators to make usage more convenient.

◆ operator const std::string &()

axom::inlet::VariantKey::operator const std::string & ( ) const

◆ type()

InletType axom::inlet::VariantKey::type ( ) const

Returns the type of the active member.

◆ operator==()

bool axom::inlet::VariantKey::operator== ( const VariantKey other) const

Comparison operator, returns true iff the active types are the same and the corresponding active members compare equal.

References axom::inlet::Integer, and axom::inlet::String.


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