LibreOffice Module pyuno (master) 1
|
Helper class for keeping references to python objects. More...
#include <pyuno.hxx>
Classes | |
struct | Hash |
Public Member Functions | |
PyRef () | |
PyRef (PyObject *p) | |
PyRef (PyObject *p, __sal_NoAcquire) | |
PyRef (PyObject *p, __sal_NoAcquire, NotNull) | |
PyRef (const PyRef &r) | |
PyRef (PyRef &&r) noexcept | |
~PyRef () | |
PyObject * | get () const noexcept |
PyObject * | getAcquired () const |
PyRef & | operator= (const PyRef &r) |
PyRef & | operator= (PyRef &&r) |
bool | operator== (const PyRef &r) const |
void | scratch () noexcept |
clears the reference without decreasing the reference count only seldom needed ! More... | |
bool | is () const |
returns 1 when the reference points to a python object python object, otherwise 0. More... | |
Private Attributes | |
PyObject * | m |
Helper class for keeping references to python objects.
BEWARE: Look up every python function you use to check whether you get an acquired or not acquired object pointer (python terminus for a not acquired object pointer is 'borrowed reference'). Use in the acquired pointer cases the PyRef( pointer, SAL_NO_ACQUIRE) ctor.
precondition: python has been initialized before and the global interpreter lock is held
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinenoexcept |
Definition at line 99 of file pyuno.hxx.
References m.
Referenced by pyuno::Runtime::any2PyObject(), pyuno::callCtor(), pyuno::createClass(), pyuno::Runtime::extractUnoException(), pyuno::getClass(), pyuno::getObjectFromUnoModule(), pyuno::getRuntimeImpl(), pyuno::Adapter::getValue(), pyuno::Adapter::hasProperty(), pyuno::importUnoModule(), pyuno::Runtime::initialize(), pyuno::Adapter::invoke(), pyuno::invokeGetTypes(), pyuno::Runtime::isInitialized(), pyuno::isInstanceOfStructOrException(), pyuno::lcl_ExceptionMessage(), pyuno::lcl_getitem_slice(), pyuno::lcl_getitem_XCellRange(), pyuno::lcl_indexToSlice(), pyuno::lcl_setitem_slice(), pyuno::PyRef::Hash::operator()(), pyuno::Runtime::operator=(), operator==(), pyuno::Runtime::pyIterUnpack(), pyuno::Runtime::pyObject2Any(), pyuno::PyType2Type(), pyuno::PyUNO_callable_call(), pyuno::PyUNO_contains(), pyuno::PyUNO_getattr(), pyuno::PyUNO_invoke(), pyuno_loader::pyuno_Loader_get_implementation(), pyuno::PyUNOStruct_getattr(), pyuno::raisePyExceptionWithAny(), pyuno::Runtime::Runtime(), pyuno::Adapter::setValue(), and pyuno::Adapter::~Adapter().
|
inline |
Definition at line 101 of file pyuno.hxx.
References m.
Referenced by pyuno::Runtime::any2PyObject(), pyuno::createClass(), pyuno::Runtime::extractUnoException(), pyuno::Adapter::invoke(), pyuno::lcl_getitem_index(), pyuno::lcl_getitem_slice(), pyuno::lcl_getitem_string(), pyuno::lcl_getitem_XCellRange(), operator=(), pyuno::PyUNO_ByteSequence_new(), pyuno::PyUNO_callable_call(), pyuno::PyUNO_invoke(), pyuno::PyUNO_iter(), pyuno::PyUNO_iterator_next(), pyuno::PyUNO_list_iterator_next(), pyuno_loader::pyuno_Loader_get_implementation(), pyuno::PyUNOStruct_getattr(), and pyuno::PyUNOStruct_repr().
|
inline |
returns 1 when the reference points to a python object python object, otherwise 0.
Definition at line 139 of file pyuno.hxx.
References m.
Referenced by pyuno::Runtime::any2PyObject(), pyuno::Runtime::extractUnoException(), pyuno::getRuntimeImpl(), pyuno::RuntimeCargo::getUnoModule(), pyuno::Adapter::getValue(), pyuno::Runtime::initialize(), pyuno::Adapter::invoke(), pyuno::invokeGetTypes(), pyuno::Runtime::isInitialized(), pyuno::isInstanceOfStructOrException(), pyuno::lcl_PyNumber_AsSal_Int32(), pyuno::PyUNO_contains(), pyuno::PyUNO_invoke(), pyuno::raisePyExceptionWithAny(), and pyuno::Runtime::Runtime().
Definition at line 107 of file pyuno.hxx.
References getAcquired(), and m.
|
inline |
|
inlinenoexcept |
clears the reference without decreasing the reference count only seldom needed !
Definition at line 131 of file pyuno.hxx.
References m.
Referenced by pyuno::Adapter::~Adapter().
|
private |
Definition at line 81 of file pyuno.hxx.
Referenced by get(), getAcquired(), is(), operator=(), operator==(), PyRef(), scratch(), and ~PyRef().