declare some PyCXX functions for export, add PyCXX wrapper for Vector2dPy class

This commit is contained in:
wmayer 2016-11-24 15:25:48 +01:00
parent cdf45248dc
commit 95768acf65
4 changed files with 5 additions and 3 deletions

View File

@ -108,7 +108,7 @@ Vector2dPy::~Vector2dPy()
void Vector2dPy::init_type(void)
{
behaviors().name( "Vector2dPy" );
behaviors().name( "Vector2d" );
behaviors().doc( "Vector2d class" );
behaviors().supportGetattro();
behaviors().supportSetattro();

View File

@ -76,6 +76,8 @@ private:
namespace Py {
typedef PythonClassObject<Base::Vector2dPy> Vector2d;
// Implementing the vector class in the fashion of the PyCXX library.
class BaseExport Vector : public Object
{

View File

@ -104,7 +104,7 @@
namespace Py
{
extern PythonExtensionBase *getPythonExtensionBase( PyObject *self );
PYCXX_EXPORT extern PythonExtensionBase *getPythonExtensionBase( PyObject *self );
struct PythonClassInstance
{

View File

@ -650,7 +650,7 @@ PythonType &PythonType::supportIter()
// Handlers
//
//--------------------------------------------------------------------------------
PythonExtensionBase *getPythonExtensionBase( PyObject *self )
PYCXX_EXPORT PythonExtensionBase *getPythonExtensionBase( PyObject *self )
{
if( self->ob_type->tp_flags&Py_TPFLAGS_BASETYPE )
{