VTK
Public Member Functions | List of all members
vtkSmartPyObject Class Reference

#include <vtkSmartPyObject.h>

Public Member Functions

 vtkSmartPyObject (PyObject *obj=NULL)
 
 vtkSmartPyObject (const vtkSmartPyObject &other)
 
 ~vtkSmartPyObject ()
 
vtkSmartPyObjectoperator= (const vtkSmartPyObject &other)
 
vtkSmartPyObjectoperator= (PyObject *obj)
 
void TakeReference (PyObject *obj)
 
PyObjectoperator-> () const
 
 operator PyObject * () const
 
 operator bool () const
 
PyObjectReleaseReference ()
 
PyObjectGetPointer () const
 
PyObjectGetAndIncreaseReferenceCount ()
 

Detailed Description

The vtkSmartPyObject class serves as a smart pointer for PyObjects.

Definition at line 29 of file vtkSmartPyObject.h.

Constructor & Destructor Documentation

vtkSmartPyObject::vtkSmartPyObject ( PyObject obj = NULL)

Creates a new vtkSmartPyObject managing the existing reference to the object given

vtkSmartPyObject::vtkSmartPyObject ( const vtkSmartPyObject other)

Creates a new vtkSmartPyObject to the object in the other smart pointer and increments the reference count to the object

vtkSmartPyObject::~vtkSmartPyObject ( )

Decrements the reference count to the object

Member Function Documentation

vtkSmartPyObject& vtkSmartPyObject::operator= ( const vtkSmartPyObject other)

The internal pointer is copied from the other vtkSmartPyObject. The reference count on the old object is decremented and the reference count on the new object is incremented

vtkSmartPyObject& vtkSmartPyObject::operator= ( PyObject obj)

Sets the internal pointer to the given PyObject. The reference count on the PyObject is incremented. To take a reference without incrementing the reference count use TakeReference.

void vtkSmartPyObject::TakeReference ( PyObject obj)

Sets the internal pointer to the given PyObject without incrementing the reference count

PyObject* vtkSmartPyObject::operator-> ( ) const

Provides normal pointer target member access using operator ->.

vtkSmartPyObject::operator PyObject * ( ) const

Get the contained pointer.

vtkSmartPyObject::operator bool ( ) const

Returns true if the internal pointer is to a valid PyObject.

PyObject* vtkSmartPyObject::ReleaseReference ( )

Returns the pointer to a PyObject stored internally and clears the internally stored pointer. The caller is responsible for calling Py_DECREF on the returned object when finished with it as this does not change the reference count.

PyObject* vtkSmartPyObject::GetPointer ( ) const

Returns the internal pointer to a PyObject with no effect on its reference count

PyObject* vtkSmartPyObject::GetAndIncreaseReferenceCount ( )

Returns the internal pointer to a PyObject and incrments its reference count


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