[pygccxml-development] type_traits.has_public_destructor problem
Brought to you by:
mbaas,
roman_yakovenko
|
From: Gustavo C. <gjc...@gm...> - 2008-07-06 15:07:06
|
When parsing a simple class like:
/**
* \brief a 3d cartesian position vector
*
* Unit is meters.
*/
class Vector
{
public:
/**
* \param _x x coordinate of vector vector
* \param _y y coordinate of vector vector
* \param _z z coordinate of vector vector
*
* Create vector vector (_x, _y, _z)
*/
Vector (double _x, double _y, double _z);
/**
* Create vector vector (0.0, 0.0, 0.0)
*/
Vector ();
/**
* x coordinate of vector vector
*/
double x;
/**
* y coordinate of vector vector
*/
double y;
/**
* z coordinate of vector vector
*/
double z;
};
pygccxml.declarations.type_traits.has_public_destructor is returning False.
The class has an implicit public destructor, so pygccxml is wrong (0.9.5).
In my code I am working around this problem like this:
+ def _has_public_destructor(self, cls):
+ for member in cls.get_members():
+ if isinstance(member, calldef.destructor_t):
+ if member.access_type != 'public':
+ return False
+ return True
Regards.
--
Gustavo J. A. M. Carneiro
INESC Porto, Telecommunications and Multimedia Unit
"The universe is always one step beyond logic." -- Frank Herbert
|