|
resonance 1.0.1
|
Handle on a Python integer. More...
#include <int.h>


Public Member Functions | |
| Int (const Object &ob) | |
| Convert another handle's object to an integer. | |
| Int (long long nValue) | |
| Wrap the interpreter's 64-bit long as an integer. | |
| Int & | operator= (const Object &ob) |
| Take another handle's object, converted to an integer. | |
| Int & | operator= (PyObject *pyob) |
| Take a reference, converted to an integer. | |
| Int & | operator= (int nValue) |
| Take a value. | |
| Int & | operator= (long long nValue) |
| Take a 64-bit value, the same way as the int overload. | |
| operator long long () const | |
| Read the value. | |
| virtual bool | accepts (PyObject *pyob) const |
| Accept only an integer. | |
| Public Member Functions inherited from Py::Object | |
| Object (PyObject *pyob=Py_None) | |
| Take a borrowed reference and add a count of its own. | |
| Object (const Object &other) | |
| Copy another handle and add a count of its own. | |
| virtual | ~Object () |
| Release the reference. | |
| Object & | operator= (const Object &other) |
| Replace the reference with another handle's. | |
| Object | getAttr (const HxStr &name) const |
| Read one attribute. | |
| String | str () const |
| Produce the text of str() applied to the object. | |
| HxStr | as_string () const |
| Produce the text of str() applied to the object, as a game string. | |
| Type | type () const |
| Produce the object's type. | |
| bool | isType (const Type &type) const |
| Report whether the object's type is a given type. | |
| bool | isTuple () const |
| Report whether the object is a tuple. | |
| bool | isList () const |
| Report whether the object is a list. | |
Additional Inherited Members | |
| Public Attributes inherited from Py::Object | |
| PyObject * | mPtr |
| Wrapped reference, null only between release() and the next assignment. | |
| Protected Member Functions inherited from Py::Object | |
| void | release () |
| Release the reference and empty the handle. | |
| void | set (PyObject *pyob) |
| Replace the reference with a borrowed one and add a count of its own. | |
| void | validate () |
| Enforce this type's accepts() test on the stored reference. | |
Handle on a Python integer.
Its RTTI descriptor is at 0x008efd90. It has Py::Object at offset 0 as its one base. Its accessor is at 0x004c63f8.
The vtable at 0x00821d58 has three entries, the same shape as Py::Object.
| Slot | Member | Address |
|---|---|---|
| 0 | compiler-generated type function | 0x004c63f8 |
| 1 | compiler-generated destructor | 0x004c6380 |
| 2 | accepts | 0x004c7218 |
|
explicit |
Convert another handle's object to an integer.
The handle starts on None, takes the result of PyNumber_Int() at 0x004a3438 through set() from a Py::FromAPI temporary, releasing None, and runs validate() once more.
| ob | The handle to convert. |
|
explicit |
Wrap the interpreter's 64-bit long as an integer.
The handle starts on None, takes the result of PyInt_FromLong() at 0x00580c68 through set() from a Py::FromAPI temporary, releasing None, and runs validate() once more.
| nValue | The value to wrap. |
Take another handle's object, converted to an integer.
| ob | The handle to convert. |
| Int & Py::Int::operator= | ( | PyObject * | pyob | ) |
Take a reference, converted to an integer.
The handle takes the result of PyNumber_Int() through set() from a Py::FromAPI temporary, unless the reference is the one it already has.
| pyob | The reference to convert. |
| Int & Py::Int::operator= | ( | int | nValue | ) |
Take a value.
The value is wrapped by PyInt_FromLong() and then converted again by the reference assignment above.
| nValue | The value. |
| Int & Py::Int::operator= | ( | long long | nValue | ) |
Take a 64-bit value, the same way as the int overload.
| nValue | The value. |
| Py::Int::operator long long | ( | ) | const |
Read the value.
The out-of-line body forwards to PyInt_AsLong(). The result is the interpreter's 64-bit long. Callers test the result at full width before any narrowing.
|
inlinevirtual |
Accept only an integer.
| pyob | The reference to test. |
Reimplemented from Py::Object.