More precisions again, I'm mapping the following function :
std::map<int,node> & getNodes(void) ;
I specify the call policy like that :
nastranDb.member_function('getNodes').call_policies =
call_policies.return_value_policy(call_policies.reference_existing_object)
Is this the good way to do?
Is there a possibility to directly get Python lists, or tuples etc?
2008/6/19, Vincent Ferries <vin...@gm...>:
> In fact, it allways produce me classes like
> pyferespost.map_less__int_comma__postLib_scope_nastran_scope_property__grate_,
> I understand the reason but, is it a way to use python lists, sets and
> dictionnaries instead of generated ones which seams to lack some
> functionalities?
> Or is it a way to implement these functionalities?
>
> 2008/6/19, Vincent Ferries <vin...@gm...>:
>> I read this unit tests before, but don't seem to get the same type of
>> vectors/maps.
>>
>> I don't really know what I am missing, maybe a wrong call policy?
>> I set the call policy of getters on those maps to
>> call_policies.reference_existing_object.
>> The module creator generate me a list of vector and map wrappers with
>> the methods I just listed above. I can't obviously access it like a
>> list or a dictionary.
>>
>> I'm using base implementation of indexing_suite (not
>> indexing_suite_v2, I have problems to compile while using it). If I
>> can access different children elements it'll be fine for me, no real
>> need of indexing_suite_v2.
>>
>> 2008/6/19, Roman Yakovenko <rom...@gm...>:
>>> On Thu, Jun 19, 2008 at 11:00 AM, Vincent Ferries
>>> <vin...@gm...> wrote:
>>>> For dictionaries you can directly use structures like :
>>>>
>>>> for (key, values) in dict:
>>>>
>>>> and the key/values elements will be matching key and list of values.
>>>>
>>>>
>>>> But I'm not able to access them in this way.
>>>>
>>>>
>>>> Using reflection to list accessibles methods on the map I get :
>>>>
>>>> __call__ x.__call__(...) <==> x(...)
>>>> __class__ instancemethod(function, instance, class) Create an
>>>> instance method object.
>>>> __cmp__ x.__cmp__(y) <==> cmp(x,y)
>>>> __delattr__ x.__delattr__('name') <==> del x.name
>>>> __get__ descr.__get__(obj[, type]) -> value
>>>> __getattribute__ x.__getattribute__('name') <==> x.name
>>>> __hash__ x.__hash__() <==> hash(x)
>>>> __init__ x.__init__(...) initializes x; see x.__class__.__doc__ for
>>>> signature
>>>> __new__ T.__new__(S, ...) -> a new object with type S, a subtype of T
>>>> __reduce__ helper for pickle
>>>> __reduce_ex__ helper for pickle
>>>> __repr__ x.__repr__() <==> repr(x)
>>>> __setattr__ x.__setattr__('name', value) <==> x.name = value
>>>> __str__ x.__str__() <==> str(x)
>>>> im_class None
>>>> im_func None
>>>>
>>>>
>>>> "values" function don't appear...
>>>
>>> Please create small test case that reproduce the problem.
>>>
>>> According to my unit tests
>>> *
>>> http://pygccxml.svn.sourceforge.net/viewvc/pygccxml/pyplusplus_dev/unittests/indexing_suites_tester.py?revision=414&view=markup
>>> *
>>> http://pygccxml.svn.sourceforge.net/viewvc/pygccxml/pyplusplus_dev/unittests/indexing_suites2_tester.py?revision=1081&view=markup
>>>
>>> the functionality works just fine.
>>>
>>>
>>>
>>> --
>>> Roman Yakovenko
>>> C++ Python language binding
>>> http://www.language-binding.net/
>>>
>>
>
|