resonance 1.0.1
Loading...
Searching...
No Matches
float.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
18class Float : public Object {
19public:
29 explicit Float(PyObject *pyob) : Object(pyob) {
30 validate();
31 }
32
41 virtual bool accepts(PyObject *pyob) const {
42 return pyob != nullptr && PyFloat_Check(pyob);
43 }
44};
45
46} // namespace Py
Float(PyObject *pyob)
Take a borrowed reference to an existing float.
Definition float.h:29
virtual bool accepts(PyObject *pyob) const
Accept only a float.
Definition float.h:41
Object(PyObject *pyob=Py_None)
Take a borrowed reference and add a count of its own.
Definition object.h:52
void validate()
Enforce this type's accepts() test on the stored reference.
Definition object.h:237
Configuration header of the PyCXX binding layer.
C++ wrappers for the embedded Python interpreter's objects, types, and extension modules.
Definition attributeerror.h:7