Type Alias simics_api_sys::attr_value_t

source ·
pub type attr_value_t = attr_value;
Expand description
attr_value_t attr_value_t attr_value_t The attr_value_t is the type used for all values in the configuration system. It is a tagged union.

The following table shows the different types of values, the type of their payload in C, and the corresponding Python types:

Kind C payload Python type
Invalid - raises exception
Stringconst char * str or unicode
Integer int64 or uint64 int or long
Boolean bool bool
Floatingdouble float
Object conf_object_t * simics.conf_object_t
List array of attr_value_t list
Dict array of pairs of attr_value_t dict
Data array of bytes tuple of small integers
Nil - None

The members inside attr_value_t should not be accessed directly. Instead, use the corresponding functions for each type:

Constructor SIM_make_attr_TYPE
DestructorSIM_attr_free
Type predicate SIM_attr_is_TYPE
AccessSIM_attr_TYPE

Values of type List and Dict can be modified using SIM_attr_TYPEset_item and SIM_attrTYPE_resize.

None of these functions are available or needed in Python. The attr_value_t values are translated to the ordinary Python values as shown in the table above.

Some values may have data in separate heap allocations. These are normally managed by the respective constructor and destructor methods, but careless copying of values may introduce aliasing errors. Use SIM_attr_copy to duplicate values. Again, this is of no concern in Python.

SIM_make_attr_int64, SIM_attr_is_integer, SIM_attr_integer, SIM_attr_free, SIM_attr_list_resize, SIM_attr_list_set_item, SIM_attr_dict_resize, SIM_attr_dict_set_item, SIM_attr_copy

Aliased Type§

struct attr_value_t {
    pub private_kind: attr_kind_t,
    pub private_size: u32,
    pub private_u: attr_value__bindgen_ty_1,
}

Fields§

§private_kind: attr_kind_t§private_size: u32§private_u: attr_value__bindgen_ty_1