The parameter_info class provides several meta information about a parameter. More...
#include <parameter_info.h>
Public Member Functions | |
variant | get_default_value () const |
Returns the default value as variant for this parameter; or an invalid variant to indicate that no default value is available. More... | |
uint32_t | get_index () const noexcept |
Returns the zero-based position of the parameter in the formal parameter list. More... | |
string_view | get_name () const noexcept |
Returns the name of this parameter. More... | |
type | get_type () const noexcept |
Returns type of this parameter. More... | |
bool | has_default_value () const noexcept |
Returns true when this parameter has a default value; otherwise false. More... | |
bool | operator!= (const parameter_info &other) const noexcept |
Returns true if this property is the not the same like the other . More... | |
bool | operator== (const parameter_info &other) const noexcept |
Returns true if this property is the same like the other . More... | |
Detailed Description
The parameter_info class provides several meta information about a parameter.
A instance of a parameter_info class can be obtained from the method or constructor class. See method::get_parameter_infos() and constructor::get_parameter_infos().
For registration additional parameter infos, see parameter_names().
Meta Information
Copying and Assignment
A parameter_info object is lightweight and can be copied by value. However, each copy will refer to the same underlying parameter_info.
Typical Usage
Output:
name: 'window name' index: 0 name: 'width' index: 1 name: 'height' index: 2
- See also
- method and constructor
Member Function Documentation
variant rttr::parameter_info::get_default_value | ( | ) | const |
|
noexcept |
Returns the zero-based position of the parameter in the formal parameter list.
- Returns
- An integer representing the position this parameter occupies in the parameter list.
|
noexcept |
Returns the name of this parameter.
When no name was provided during registration via parameter_names(), then an empty string is returned.
- Returns
- The name of the parameter.
|
noexcept |
Returns type of this parameter.
- Returns
- Parameter type.
|
noexcept |
Returns true when this parameter has a default value; otherwise false.
- Returns
- Bool to indicate that this parameter has a default value.
|
noexcept |
Returns true if this property is the not the same like the other
.
- Returns
- True if both properties are different, otherwise false.
|
noexcept |
Returns true if this property is the same like the other
.
- Returns
- True if both properties are equal, otherwise false.
The documentation for this class was generated from the following file: