IOSS  2.0
Ioss::Property Class Reference

A named value that has a known type. More...

#include <Ioss_Property.h>

Collaboration diagram for Ioss::Property:
[legend]

Classes

union  Data
 

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 ()=default
 
 Property (std::string name, int64_t value, Origin origin=INTERNAL)
 Create an INTEGER type property using an int64_t variable. More...
 
 Property (std::string name, int value, Origin origin=INTERNAL)
 Create an INTEGER type property. More...
 
 Property (std::string name, double value, Origin origin=INTERNAL)
 Create a REAL type property. More...
 
 Property (std::string name, const std::string &value, Origin origin=INTERNAL)
 Create a STRING type property. More...
 
 Property (std::string name, const char *value, Origin origin=INTERNAL)
 Create a STRING type property from const char* argument. More...
 
 Property (std::string name, void *value, Origin origin=INTERNAL)
 Create a POINTER type property. More...
 
 Property (std::string name, const std::vector< int > &value, Origin origin=INTERNAL)
 Create a VEC_INTEGER type property. More...
 
 Property (std::string name, const std::vector< double > &value, Origin origin=INTERNAL)
 Create a VEC_DOUBLE type property. More...
 
 Property (const GroupingEntity *ge, std::string name, BasicType type)
 Set implicit property with a specified type. More...
 
 Property (const Property &from)
 Copy constructor. More...
 
Property & operator= (Property rhs)
 
 ~Property ()
 
std::string get_string () const
 Get the property value if it is of type STRING. More...
 
int64_t get_int () const
 Get the property value if it is of type INTEGER. More...
 
double get_real () const
 Get the property value if it is of type REAL. More...
 
void * get_pointer () const
 Get the property value if it is of type POINTER. More...
 
std::vector< double > get_vec_double () const
 Get the property value if it is of type VEC_DOUBLE. More...
 
std::vector< int > get_vec_int () const
 Get the property value if it is of type VEC_INT. More...
 
void set_origin (Origin origin)
 
Origin get_origin () const
 
bool is_implicit () const
 Tells whether the property is calculated, rather than stored. More...
 
bool is_explicit () const
 Tells whether the property is stored, rather than calculated. More...
 
bool is_valid () const
 
bool is_invalid () const
 
std::string get_name () const
 Get the property name. More...
 
BasicType get_type () const
 Get the property type. More...
 

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}
 
Data data_ {}
 

Detailed Description

A named value that has a known type.

Member Enumeration Documentation

◆ BasicType

Enumerator
INVALID 
REAL 
INTEGER 
POINTER 
STRING 
VEC_INTEGER 
VEC_DOUBLE 

◆ Origin

Enumerator
INTERNAL 
IMPLICIT 
EXTERNAL 
ATTRIBUTE 

Constructor & Destructor Documentation

◆ Property() [1/11]

Ioss::Property::Property ( )
default

◆ Property() [2/11]

Ioss::Property::Property ( std::string  name,
int64_t  value,
Origin  origin = INTERNAL 
)

Create an INTEGER type property using an int64_t variable.

Parameters
[in]nameThe property name.
[in]valueThe property value.
[in]originThe origin of the property - IMPLICIT, or EXTERNAL, or ATTRIBUTE

◆ Property() [3/11]

Ioss::Property::Property ( std::string  name,
int  value,
Origin  origin = INTERNAL 
)

Create an INTEGER type property.

Parameters
[in]nameThe property name.
[in]valueThe property value.
[in]originThe origin of the property - IMPLICIT, or EXTERNAL, or ATTRIBUTE

◆ Property() [4/11]

Ioss::Property::Property ( std::string  name,
double  value,
Origin  origin = INTERNAL 
)

Create a REAL type property.

Parameters
[in]nameThe property name.
[in]valueThe property value.
[in]originThe origin of the property - IMPLICIT, or EXTERNAL, or ATTRIBUTE

◆ Property() [5/11]

Ioss::Property::Property ( std::string  name,
const std::string &  value,
Origin  origin = INTERNAL 
)

Create a STRING type property.

Parameters
[in]nameThe property name.
[in]valueThe property value.
[in]originThe origin of the property - IMPLICIT, or EXTERNAL, or ATTRIBUTE

◆ Property() [6/11]

Ioss::Property::Property ( std::string  name,
const char *  value,
Origin  origin = INTERNAL 
)

Create a STRING type property from const char* argument.

Parameters
[in]nameThe property name.
[in]valueThe property value.
[in]originThe origin of the property - IMPLICIT, or EXTERNAL, or ATTRIBUTE

◆ Property() [7/11]

Ioss::Property::Property ( std::string  name,
void *  value,
Origin  origin = INTERNAL 
)

Create a POINTER type property.

Parameters
[in]nameThe property name.
[in]valueThe property value.
[in]originThe origin of the property - IMPLICIT, or EXTERNAL, or ATTRIBUTE

◆ Property() [8/11]

Ioss::Property::Property ( std::string  name,
const std::vector< int > &  value,
Origin  origin = INTERNAL 
)

Create a VEC_INTEGER type property.

Parameters
[in]nameThe property name.
[in]valueThe property value.
[in]originThe origin of the property - IMPLICIT, or EXTERNAL, or ATTRIBUTE

◆ Property() [9/11]

Ioss::Property::Property ( std::string  name,
const std::vector< double > &  value,
Origin  origin = INTERNAL 
)

Create a VEC_DOUBLE type property.

Parameters
[in]nameThe property name.
[in]valueThe property value.
[in]originThe origin of the property - IMPLICIT, or EXTERNAL, or ATTRIBUTE

◆ Property() [10/11]

Ioss::Property::Property ( const GroupingEntity *  ge,
std::string  name,
BasicType  type 
)

Set implicit property with a specified type.

Parameters
[in]geThe property value.
[in]nameThe property name.
[in]typeThe property type.

◆ Property() [11/11]

Ioss::Property::Property ( const Property &  from)

Copy constructor.

Parameters
[in]fromThe Ioss::Property to copy

◆ ~Property()

Ioss::Property::~Property ( )

Member Function Documentation

◆ get_int()

int64_t Ioss::Property::get_int ( ) const

Get the property value if it is of type INTEGER.

Returns
The INTEGER-type property value

◆ get_name()

std::string Ioss::Property::get_name ( ) const
inline

Get the property name.

Returns
The property name.

◆ get_origin()

Origin Ioss::Property::get_origin ( ) const
inline

◆ get_pointer()

void * Ioss::Property::get_pointer ( ) const

Get the property value if it is of type POINTER.

Returns
The POINTER-type property value.

◆ get_real()

double Ioss::Property::get_real ( ) const

Get the property value if it is of type REAL.

Returns
The REAL-type property value.

◆ get_string()

std::string Ioss::Property::get_string ( ) const

Get the property value if it is of type STRING.

Returns
The STRING-type property value

◆ get_type()

BasicType Ioss::Property::get_type ( ) const
inline

Get the property type.

Returns
The property type.

◆ get_value() [1/6]

bool Ioss::Property::get_value ( double *  value) const
private

◆ get_value() [2/6]

bool Ioss::Property::get_value ( int64_t *  value) const
private

◆ get_value() [3/6]

bool Ioss::Property::get_value ( std::string *  value) const
private

◆ get_value() [4/6]

bool Ioss::Property::get_value ( std::vector< double > *  value) const
private

◆ get_value() [5/6]

bool Ioss::Property::get_value ( std::vector< int > *  value) const
private

◆ get_value() [6/6]

bool Ioss::Property::get_value ( void *&  value) const
private

◆ get_vec_double()

std::vector< double > Ioss::Property::get_vec_double ( ) const

Get the property value if it is of type VEC_DOUBLE.

Returns
The VEC_DOUBLE-type property value

◆ get_vec_int()

std::vector< int > Ioss::Property::get_vec_int ( ) const

Get the property value if it is of type VEC_INT.

Returns
The VEC_INT-type property value

◆ is_explicit()

bool Ioss::Property::is_explicit ( ) const
inline

Tells whether the property is stored, rather than calculated.

Returns
True if property is stored directly; False if it is calculated.

◆ is_implicit()

bool Ioss::Property::is_implicit ( ) const
inline

Tells whether the property is calculated, rather than stored.

Returns
True if property is calculated; False if it is stored directly.

◆ is_invalid()

bool Ioss::Property::is_invalid ( ) const
inline

Tells whether the property has an invalid type (currently not one of REAL, INTEGER, POINTER, or STRING)

Returns
True if the property type is invalid.

◆ is_valid()

bool Ioss::Property::is_valid ( ) const
inline

Tells whether the property has a valid type (currently REAL, INTEGER, POINTER, or STRING)

Returns
True if the property type is valid.

◆ operator=()

Ioss::Property & Ioss::Property::operator= ( Ioss::Property  rhs)

◆ set_origin()

void Ioss::Property::set_origin ( Origin  origin)
inline

Member Data Documentation

◆ data_

Data Ioss::Property::data_ {}
private

◆ name_

std::string Ioss::Property::name_ {}
private

◆ origin_

Origin Ioss::Property::origin_ {INTERNAL}
private

True if property is calculated rather than stored. False if property is stored in 'data_'

◆ type_

BasicType Ioss::Property::type_ {INVALID}
private

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