LibreOffice Module pyuno (master)  1
Classes | Public Member Functions | Private Attributes | List of all members
pyuno::PyRef Class Reference

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
 
PyRefoperator= (const PyRef &r)
 
PyRefoperator= (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
 

Detailed Description

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

Definition at line 79 of file pyuno.hxx.

Constructor & Destructor Documentation

pyuno::PyRef::PyRef ( )
inline

Definition at line 83 of file pyuno.hxx.

pyuno::PyRef::PyRef ( PyObject *  p)
inline

Definition at line 84 of file pyuno.hxx.

pyuno::PyRef::PyRef ( PyObject *  p,
__sal_NoAcquire   
)
inline

Definition at line 86 of file pyuno.hxx.

pyuno::PyRef::PyRef ( PyObject *  p,
__sal_NoAcquire  ,
NotNull   
)
inline

Definition at line 88 of file pyuno.hxx.

pyuno::PyRef::PyRef ( const PyRef r)
inline

Definition at line 94 of file pyuno.hxx.

pyuno::PyRef::PyRef ( PyRef &&  r)
inlinenoexcept

Definition at line 95 of file pyuno.hxx.

pyuno::PyRef::~PyRef ( )
inline

Definition at line 97 of file pyuno.hxx.

Member Function Documentation

PyObject* pyuno::PyRef::get ( ) const
inlinenoexcept
PyObject* pyuno::PyRef::getAcquired ( ) const
inline
bool pyuno::PyRef::is ( ) const
inline
PyRef& pyuno::PyRef::operator= ( const PyRef r)
inline

Definition at line 107 of file pyuno.hxx.

References getAcquired(), and m.

PyRef& pyuno::PyRef::operator= ( PyRef &&  r)
inline

Definition at line 115 of file pyuno.hxx.

References m.

bool pyuno::PyRef::operator== ( const PyRef r) const
inline

Definition at line 124 of file pyuno.hxx.

References get(), and m.

void pyuno::PyRef::scratch ( )
inlinenoexcept

clears the reference without decreasing the reference count only seldom needed !

Definition at line 131 of file pyuno.hxx.

Referenced by pyuno::Adapter::~Adapter().

Member Data Documentation

PyObject* pyuno::PyRef::m
private

Definition at line 81 of file pyuno.hxx.

Referenced by get(), getAcquired(), operator=(), and operator==().


The documentation for this class was generated from the following file: