OpenLexocad  27.1
Base::PyHandle< HandledType > Class Template Reference

#include <PyExport.h>

Public Member Functions

 PyHandle (HandledType *ToHandel=0L)
 
 PyHandle (const PyHandle< HandledType > &ToHandel)
 Copy constructor. More...
 
 ~PyHandle ()
 
PyHandle< HandledType > & operator= (HandledType *other)
 
PyHandle< HandledType > & operator= (const PyHandle< HandledType > &other)
 
HandledType & operator * ()
 derefrence operators More...
 
HandledType * operator-> ()
 derefrence operators More...
 
const HandledType & operator * () const
 derefrence operators More...
 
const HandledType * operator-> () const
 derefrence operators More...
 
bool operator< (const PyHandle< HandledType > &other) const
 
bool operator== (const PyHandle< HandledType > &other) const
 equal operator More...
 
PyObjectGetPyObject (void)
 returns the type as PyObject More...
 
bool IsValid (void) const
 Test if it handels something. More...
 
bool IsNull (void) const
 Test if it not handels something. More...
 

Detailed Description

template<class HandledType>
class Base::PyHandle< HandledType >

Python Object handle class Using pointers on classes derived from PyObjectBase would be potentionaly dangerous because you would have to take care of the referenc counting of python by your self. There fore this class was designd. It takes care of references and as long as a object of this class exists the handled class get not destructed. That means a PyObjectBase derived object you can only destruct by destructing all FCPyHandle and all python references on it!

See also
PyObjectBase,FCDocument

Constructor & Destructor Documentation

◆ PyHandle() [1/2]

template<class HandledType>
Base::PyHandle< HandledType >::PyHandle ( HandledType *  ToHandel = 0L)
inline

pointer and default constructor the good way would be not using pointer instead using a overwriten new operator in the HandledType class! But is not easy to inforce!

◆ PyHandle() [2/2]

template<class HandledType>
Base::PyHandle< HandledType >::PyHandle ( const PyHandle< HandledType > &  ToHandel)
inline

Copy constructor.

◆ ~PyHandle()

template<class HandledType>
Base::PyHandle< HandledType >::~PyHandle ( )
inline

destructor Release the referenc count which cause, if was the last one, the referenced object to destruct!

Member Function Documentation

◆ GetPyObject()

template<class HandledType>
PyObject* Base::PyHandle< HandledType >::GetPyObject ( void  )
inline

returns the type as PyObject

◆ IsNull()

template<class HandledType>
bool Base::PyHandle< HandledType >::IsNull ( void  ) const
inline

Test if it not handels something.

◆ IsValid()

template<class HandledType>
bool Base::PyHandle< HandledType >::IsValid ( void  ) const
inline

Test if it handels something.

◆ operator *() [1/2]

template<class HandledType>
HandledType& Base::PyHandle< HandledType >::operator * ( )
inline

derefrence operators

◆ operator *() [2/2]

template<class HandledType>
const HandledType& Base::PyHandle< HandledType >::operator * ( ) const
inline

derefrence operators

◆ operator->() [1/2]

template<class HandledType>
HandledType* Base::PyHandle< HandledType >::operator-> ( )
inline

derefrence operators

◆ operator->() [2/2]

template<class HandledType>
const HandledType* Base::PyHandle< HandledType >::operator-> ( ) const
inline

derefrence operators

◆ operator<()

template<class HandledType>
bool Base::PyHandle< HandledType >::operator< ( const PyHandle< HandledType > &  other) const
inline

lower operator needed for sorting in maps and sets

◆ operator=() [1/2]

template<class HandledType>
PyHandle<HandledType>& Base::PyHandle< HandledType >::operator= ( HandledType *  other)
inline

◆ operator=() [2/2]

template<class HandledType>
PyHandle<HandledType>& Base::PyHandle< HandledType >::operator= ( const PyHandle< HandledType > &  other)
inline

◆ operator==()

template<class HandledType>
bool Base::PyHandle< HandledType >::operator== ( const PyHandle< HandledType > &  other) const
inline

equal operator


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