class documentation
class Integer(_Type):
Known subclasses: reven2.types._integer.ArchDependentInteger
, reven2.types._integer.BigEndian
, reven2.types._integer.FixedWidthInteger
, reven2.types._integer.LittleEndian
An abstract class whose instances represent the types of integer.
Implementers must specialize the following methods:
Method | __eq__ |
Compares the instance for equality with an object. |
Method | __hash__ |
Returns the hash for this value. |
Method | __ne__ |
Compares the instance for equality with an object. |
Method | size |
The minimal number of bytes necessary to hold an instance of this integer type. |
Property | endianness |
Property: The endianness of this integer type. |
Property | signedness |
Property: The signedness of this integer type. |
Method | _construct |
Return the underlying construct instance |
Method | _possible |
Undocumented |
Inherited from Type
:
Method | description |
The short description of this type. |
Method | is |
Whether the context argument needed by some methods actually has an effect. |
Method | parse |
Parses the value of an instance of this type from a raw buffer, possibly depending on the context. |
Method | to |
Build a byte buffer from a value of this type. |
Method | _resolve |
Uses the resolver to return a resolved version of the type, if possible. |
def __eq__(self, o):
Compares the instance for equality with an object.
- if the object is not an
Integer
, it will never be equal to this instance.
Parameters | |
o:object | Undocumented |
Returns | |
bool | Undocumented |
def __ne__(self, o):
Compares the instance for equality with an object.
- if the object is not an
Integer
, it will never be equal to this instance.
Parameters | |
o:object | Undocumented |
Returns | |
bool | Undocumented |
def size_bytes(self, context=None):
overrides
reven2.types._type.Type.size_bytes
overridden in
reven2.types._integer.ArchDependentInteger
, reven2.types._integer.BigEndian
, reven2.types._integer.FixedWidthInteger
, reven2.types._integer.LittleEndian
The minimal number of bytes necessary to hold an instance of this integer type.
Information
Parameters | |
context:_Optional[ | The context object. See package documentation. |
Returns | |
int | Undocumented |
Raises | |
NotImplementedError | If not reimplemented by a subclass. |
overridden in
reven2.types._integer.ArchDependentInteger
, reven2.types._integer.BigEndian
, reven2.types._integer.FixedWidthInteger
, reven2.types._integer.LittleEndian
Property: The endianness of this integer type.
Information
Raises | |
NotImplementedError | If not reimplemented by a subclass. |
overridden in
reven2.types._integer.ArchDependentInteger
, reven2.types._integer.BigEndian
, reven2.types._integer.FixedWidthInteger
, reven2.types._integer.LittleEndian
Property: The signedness of this integer type.
Information
Raises | |
NotImplementedError | If not reimplemented by a subclass. |
def _construct_type(self, context=None):
overrides
reven2.types._type.Type._construct_type
Return the underlying construct instance
Parameters | |
context:_Optional[ | Undocumented |
Returns | |
_construct.BytesInteger | Undocumented |
def _possible_sizes(self):
overridden in
reven2.types._integer.ArchDependentInteger
, reven2.types._integer.BigEndian
, reven2.types._integer.FixedWidthInteger
, reven2.types._integer.LittleEndian
Undocumented
Returns | |
_Iterator[ | Undocumented |