Lines Matching refs:object

319  * The returned object should be short-lived: in particular, it must not outlive the called-upon
515 auto inst = reinterpret_steal<object>(make_new_instance(tinfo->type));
538 "object is non-copyable!");
549 "object is neither movable nor copyable!");
697 auto temp = reinterpret_steal<object>(converter(src.ptr(), typeinfo->type));
792 // polymorphic_type_hook<itype>::get(src, tinfo) determines whether the object pointed
795 // type, and returns a pointer to the start of the most-derived object of that type
801 // types determines the runtime type of the passed object and adjusts the this-pointer
854 // with pybind11, we want to make the full derived object available.
1014 auto tmp = reinterpret_steal<object>(std::is_floating_point<T>::value
1176 object temp;
1193 temp = reinterpret_steal<object>(PyUnicode_FromObject(load_src.ptr()));
1199 object utfNbytes = reinterpret_steal<object>(PyUnicode_AsEncodedString(
1208 // If we're loading a string_view we need to keep the encoded Python object alive:
1241 // When loading into a std::string or char*, accept a bytes object as-is (i.e.
1407 std::array<object, size> entries{{
1408 reinterpret_steal<object>(make_caster<Ts>::cast(std::get<Is>(std::forward<T>(src)), policy, parent))...
1567 template <typename T = type, enable_if_t<std::is_base_of<object, T>::value, int> = 0>
1590 // - if the type is non-copy-constructible, the object must be the sole owner of the type (i.e. it
1670 T cast(const handle &handle) { return T(reinterpret_borrow<object>(handle)); }
1672 // C++ type -> py::object
1674 object cast(const T &value, return_value_policy policy = return_value_policy::automatic_reference,
1680 return reinterpret_steal<object>(detail::make_caster<T>::cast(value, policy, parent));
1687 detail::enable_if_t<!detail::move_never<T>::value, T> move(object &&obj) {
1702 // Calling cast() on an rvalue calls pybind::cast with the object rvalue, which does:
1704 // object has multiple references, but trying to copy will fail to compile.
1707 template <typename T> detail::enable_if_t<detail::move_always<T>::value, T> cast(object &&object) {
1708 return move<T>(std::move(object));
1710 template <typename T> detail::enable_if_t<detail::move_if_unreferenced<T>::value, T> cast(object &&object) {
1711 if (object.ref_count() > 1)
1712 return cast<T>(object);
1714 return move<T>(std::move(object));
1716 template <typename T> detail::enable_if_t<detail::move_never<T>::value, T> cast(object &&object) {
1717 return cast<T>(object);
1720 template <typename T> T object::cast() const & { return pybind11::cast<T>(*this); }
1721 template <typename T> T object::cast() && { return pybind11::cast<T>(std::move(*this)); }
1722 template <> inline void object::cast() const & { return; }
1723 template <> inline void object::cast() && { return; }
1729 object object_or_cast(T &&o) { return pybind11::cast(std::forward<T>(o)); }
1737 template <typename T> enable_if_t<cast_is_temporary_value_reference<T>::value, T> cast_ref(object &&o, make_caster<T> &caster) {
1740 template <typename T> enable_if_t<!cast_is_temporary_value_reference<T>::value, T> cast_ref(object &&, overload_unused &) {
1746 template <typename T> enable_if_t<!cast_is_temporary_value_reference<T>::value, T> cast_safe(object &&o) {
1748 template <typename T> enable_if_t<cast_is_temporary_value_reference<T>::value, T> cast_safe(object &&) {
1750 template <> inline void cast_safe<void>(object &&) {}
1760 std::array<object, size> args {
1761 { reinterpret_steal<object>(detail::make_caster<Args>::cast(
1767 throw cast_error("make_tuple(): unable to convert arguments to Python object (compile in debug mode for details)");
1771 argtypes[i] + "' to Python object");
1806 value(reinterpret_steal<object>(
1833 object value;
1875 object args_ref, kwargs_ref;
1956 object call(PyObject *ptr) const {
1960 return reinterpret_steal<object>(result);
1989 object call(PyObject *ptr) const {
1993 return reinterpret_steal<object>(result);
1999 auto o = reinterpret_steal<object>(detail::make_caster<T>::cast(std::forward<T>(x), policy, {}));
2074 throw cast_error("Unable to convert call argument to Python object "
2080 + "' of type '" + type + "' to Python object");
2111 object object_api<Derived>::operator()(Args &&...args) const {
2117 object object_api<Derived>::call(Args &&...args) const {