resonance 1.0.1
Loading...
Searching...
No Matches
int.h
Go to the documentation of this file.
1#pragma once
2
3#include "script/cxx/config.h"
4#include "script/cxx/object.h"
5
6namespace Py {
7
22class Int : public Object {
23public:
34 explicit Int(const Object &ob);
35
46 explicit Int(long long nValue);
47
56 Int &operator=(const Object &ob);
57
69 Int &operator=(PyObject *pyob);
70
82 Int &operator=(int nValue);
83
92 Int &operator=(long long nValue);
93
104 operator long long() const;
105
114 virtual bool accepts(PyObject *pyob) const {
115 return pyob != nullptr && PyInt_Check(pyob);
116 }
117};
118
119} // namespace Py
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.
virtual bool accepts(PyObject *pyob) const
Accept only an integer.
Definition int.h:114
Int & operator=(int nValue)
Take a value.
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=(long long nValue)
Take a 64-bit value, the same way as the int overload.
Object(PyObject *pyob=Py_None)
Take a borrowed reference and add a count of its own.
Definition object.h:52
Configuration header of the PyCXX binding layer.
C++ wrappers for the embedded Python interpreter's objects, types, and extension modules.
Definition attributeerror.h:7