class EnumerationInstance:
An enumeration instance, the result of reading an enumeration.
Access the value of this instance with the EnumerationInstance.value
method, or check if it is exactly one member from the enumeration with the EnumerationInstance.is_exactly
method.
For flag enumerations, check if a member of the enumeration is part of the value with the EnumerationInstance.is_also
method.
Method | __eq__ |
Compares the instance for equality with an object. |
Method | __hash__ |
Returns the hash for this value. |
Method | __init__ |
Initializes a new enumeration instance from its enum type and its value. |
Method | __ne__ |
Compares the instance for equality with an object. |
Method | __str__ |
Returns the nicely printable string representation of this instance. |
Method | is |
Whether or not the value corresponds to the passed member of the enumeration, possibly with other members also applied as bitwise-or. |
Method | is |
Whether or not the value corresponds exactly to the passed member of the enumeration. |
Property | type |
The type of this instance. |
Property | value |
The value of this instance. |
Instance Variable | _enumeration |
Undocumented |
Instance Variable | _value |
Undocumented |
Compares the instance for equality with an object.
- if the object is of type str, int or
Item
, it will be considered equal to this instance if this instance self.is_exactly(o) is True. - two
EnumerationInstance
s are considered equal if they have the same underlyingEnumeration
and value. - if the object is none of the types above, then it will never be considered equal.
Note
- The context where this enum was spawned at is never taken into consideration for the purpose of equality. This means that two
EnumerationInstance
s at different contexts with the same type and value will be considered equal. - Similarly, the source from which the instance was read is never taken into consideration for the purpose of equality. This means that two
EnumerationInstance
s coming from different addresses in memory or different registers can compare equal if they have the same type and value.
Parameters | |
o:object | Undocumented |
Returns | |
bool | Undocumented |
Initializes a new enumeration instance from its enum type and its value.
Warnings
At the moment, this object is not meant to be constructed directly. Use FieldInstance.read
instead.
Parameters | |
enumeration:_Enumeration | Undocumented |
value:int | Undocumented |
Compares the instance for equality with an object.
- if the object is of type str, int or
Item
, it will be considered equal to this instance if this instance self.is_exactly(o) is True. - two
EnumerationInstance
s are considered equal if they have the same underlyingEnumeration
and value. - if the object is none of the types above, then it will never be considered equal.
Note
- The context where this enum was spawned at is never taken into consideration for the purpose of equality. This means that two
EnumerationInstance
s at different contexts with the same type and value will be considered equal. - Similarly, the source from which the instance was read is never taken into consideration for the purpose of equality. This means that two
EnumerationInstance
s coming from different addresses in memory or different registers can compare equal if they have the same type and value.
Parameters | |
o:object | Undocumented |
Returns | |
bool | Undocumented |
Returns the nicely printable string representation of this instance.
Returns | |
str | Undocumented |
Whether or not the value corresponds to the passed member of the enumeration, possibly with other members also applied as bitwise-or.
Enumerations in C are often used as flags, this method allows to determine if a member of an enum flag is part of the value of this instance.
Parameters | |
item:_Union[ | Undocumented |
Returns | |
bool | Undocumented |
Whether or not the value corresponds exactly to the passed member of the enumeration.
Parameters | |
item:_Union[ | Undocumented |
Returns | |
bool | Undocumented |