IOSS 2.0
|
A named value that has a known type. More...
#include <Ioss_Property.h>
Public Types | |
enum | BasicType { INVALID = -1 , REAL , INTEGER , POINTER , STRING , VEC_INTEGER , VEC_DOUBLE } |
enum | Origin { INTERNAL = -1 , IMPLICIT , EXTERNAL , ATTRIBUTE } |
Public Member Functions | |
Property (std::string name, int64_t value, Origin origin=INTERNAL) | |
Create an INTEGER type property using an int64_t variable. | |
Property (std::string name, int value, Origin origin=INTERNAL) | |
Create an INTEGER type property. | |
Property (std::string name, double value, Origin origin=INTERNAL) | |
Create a REAL type property. | |
Property (std::string name, const std::string &value, Origin origin=INTERNAL) | |
Create a STRING type property. | |
Property (std::string name, const char *value, Origin origin=INTERNAL) | |
Create a STRING type property from const char* argument. | |
Property (std::string name, void *value, Origin origin=INTERNAL) | |
Create a POINTER type property. | |
Property (std::string name, const std::vector< int > &value, Origin origin=INTERNAL) | |
Create a VEC_INTEGER type property. | |
Property (std::string name, const std::vector< double > &value, Origin origin=INTERNAL) | |
Create a VEC_DOUBLE type property. | |
Property (const GroupingEntity *ge, std::string name, BasicType type) | |
Set implicit property with a specified type. | |
IOSS_NODISCARD std::string | get_string () const |
Get the property value if it is of type STRING. | |
IOSS_NODISCARD int64_t | get_int () const |
Get the property value if it is of type INTEGER. | |
IOSS_NODISCARD double | get_real () const |
Get the property value if it is of type REAL. | |
IOSS_NODISCARD void * | get_pointer () const |
Get the property value if it is of type POINTER. | |
IOSS_NODISCARD std::vector< double > | get_vec_double () const |
Get the property value if it is of type VEC_DOUBLE. | |
IOSS_NODISCARD std::vector< int > | get_vec_int () const |
Get the property value if it is of type VEC_INT. | |
void | set_origin (Origin origin) |
IOSS_NODISCARD Origin | get_origin () const |
IOSS_NODISCARD bool | is_implicit () const |
Tells whether the property is calculated, rather than stored. | |
IOSS_NODISCARD bool | is_explicit () const |
Tells whether the property is stored, rather than calculated. | |
IOSS_NODISCARD bool | is_valid () const |
IOSS_NODISCARD bool | is_invalid () const |
IOSS_NODISCARD std::string | get_name () const |
Get the property name. | |
IOSS_NODISCARD BasicType | get_type () const |
Get the property type. | |
IOSS_NODISCARD bool | operator!= (const Ioss::Property &rhs) const |
IOSS_NODISCARD bool | operator== (const Ioss::Property &rhs) const |
Private Member Functions | |
bool | get_value (int64_t *value) const |
bool | get_value (double *value) const |
bool | get_value (std::string *value) const |
bool | get_value (void *&value) const |
bool | get_value (std::vector< double > *value) const |
bool | get_value (std::vector< int > *value) const |
Private Attributes | |
std::string | name_ {} |
BasicType | type_ {INVALID} |
Origin | origin_ {INTERNAL} |
std::variant< std::string, const Ioss::GroupingEntity *, double, int64_t, std::vector< double >, std::vector< int >, void * > | data_ |
A named value that has a known type.
Create an INTEGER type property using an int64_t variable.
[in] | name | The property name. |
[in] | value | The property value. |
[in] | origin | The origin of the property - IMPLICIT, or EXTERNAL, or ATTRIBUTE |
Create an INTEGER type property.
[in] | name | The property name. |
[in] | value | The property value. |
[in] | origin | The origin of the property - IMPLICIT, or EXTERNAL, or ATTRIBUTE |
Create a REAL type property.
[in] | name | The property name. |
[in] | value | The property value. |
[in] | origin | The origin of the property - IMPLICIT, or EXTERNAL, or ATTRIBUTE |
Create a STRING type property.
[in] | name | The property name. |
[in] | value | The property value. |
[in] | origin | The origin of the property - IMPLICIT, or EXTERNAL, or ATTRIBUTE |
Create a STRING type property from const char* argument.
[in] | name | The property name. |
[in] | value | The property value. |
[in] | origin | The origin of the property - IMPLICIT, or EXTERNAL, or ATTRIBUTE |
Create a POINTER type property.
[in] | name | The property name. |
[in] | value | The property value. |
[in] | origin | The origin of the property - IMPLICIT, or EXTERNAL, or ATTRIBUTE |
Ioss::Property::Property | ( | std::string | name, |
const std::vector< int > & | value, | ||
Origin | origin = INTERNAL ) |
Create a VEC_INTEGER type property.
[in] | name | The property name. |
[in] | value | The property value. |
[in] | origin | The origin of the property - IMPLICIT, or EXTERNAL, or ATTRIBUTE |
Ioss::Property::Property | ( | std::string | name, |
const std::vector< double > & | value, | ||
Origin | origin = INTERNAL ) |
Create a VEC_DOUBLE type property.
[in] | name | The property name. |
[in] | value | The property value. |
[in] | origin | The origin of the property - IMPLICIT, or EXTERNAL, or ATTRIBUTE |
Ioss::Property::Property | ( | const GroupingEntity * | ge, |
std::string | name, | ||
BasicType | type ) |
Set implicit property with a specified type.
[in] | ge | The property value. |
[in] | name | The property name. |
[in] | type | The property type. |
int64_t Ioss::Property::get_int | ( | ) | const |
Get the property value if it is of type INTEGER.
|
inline |
Get the property name.
|
inline |
void * Ioss::Property::get_pointer | ( | ) | const |
Get the property value if it is of type POINTER.
double Ioss::Property::get_real | ( | ) | const |
Get the property value if it is of type REAL.
std::string Ioss::Property::get_string | ( | ) | const |
Get the property value if it is of type STRING.
|
inline |
Get the property type.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
std::vector< double > Ioss::Property::get_vec_double | ( | ) | const |
Get the property value if it is of type VEC_DOUBLE.
std::vector< int > Ioss::Property::get_vec_int | ( | ) | const |
Get the property value if it is of type VEC_INT.
|
inline |
Tells whether the property is stored, rather than calculated.
|
inline |
Tells whether the property is calculated, rather than stored.
|
inline |
Tells whether the property has an invalid type (currently not one of REAL, INTEGER, POINTER, or STRING)
|
inline |
Tells whether the property has a valid type (currently REAL, INTEGER, POINTER, or STRING)
bool Ioss::Property::operator!= | ( | const Ioss::Property & | rhs | ) | const |
bool Ioss::Property::operator== | ( | const Ioss::Property & | rhs | ) | const |
|
inline |
|
private |
The actual value of the property. Use 'type_' to discriminate the actual type of the property.
|
private |
True if property is calculated rather than stored. False if property is stored in 'data_'