← Back to team overview

yade-dev team mailing list archive

Re: macros for exposing classes to python

 

Hello, still a question about this, and especially the "can be empty" of the following §

Václav Šmilauer a écrit :
----

/* Macros for registering classes in python, serialization framework,
class factory. These macros create default (parameterless) constructor,
declare all attributes (delete those from the class elsewhere) and
initialize them at construction time.

Each part of macro name is one argument you have to provide:

ATTRS: list of attributes ((type,attributeName,defaultValue,"documentation for the attribute"))
    type is c++ type
attributeName: the identifier name; it will appear under the same name in python defaultValue: value that will be set by the default ctor; can be empty. Is automatically documented.
^^^^^^^^^^^^ From what I've understood of the examples of Bruno, the values of registered attributes, which have to be set by the constructor have to be put here, not in the following § of the macro : CTOR. Moreover, now I still do not use this defaut value, I have still plenty or errors :

error: macro "BOOST_PP_TUPLE_ELEM_4_0" requires 4 arguments, but only 3 given

, which could correspond to the fact that I did not yet define this defaut value in my :

((Real,coeff_dech,"=kn(unload) / kn(load)"))

So, a fourth group in this parenthese with the defaultValue, or not ?

Thanks,

Jerome



Follow ups

References