Re: [pygccxml-development] [FT]input_t class - new vision.
Brought to you by:
mbaas,
roman_yakovenko
From: Roman Y. <rom...@gm...> - 2006-09-15 14:36:29
|
On 9/15/06, Matthias Baas <ba...@ir...> wrote: > Roman Yakovenko wrote: > > from pygccxml import declarations > > type_transformation_t ? > > > > def __init__( self, arg_id, transformation=None ): > > self.arg_id = arg_id > > if None is self.transformation: > > #by default just remove reference > > #because I expect this will be applied to immutable passed by ref > > self.transformation = lambda type_: > > declarations.remove_reference( type_ ) > > elif is_callable( transformation ): > > #let user define the transformation > > self.transformation = transformation > > else: > > #user already knows what he wants, so we will just use it > > assert isinstance( transformation, declarations.type_t ) > > self.transformation = lambda type_: transformation > > > > transf = type_transformation_t( 1 > > , lambda type_: declarations.remove_reference( > > > > declarations.remove_const( type_ ) ) ) > > > > Something like this. > > Your example uses an entirely different interface than what is currently > implemented, but I guess I can see what you want to have. > > I agree that functionality like this could be useful, I'd suggest to > implement it as an additional transformer though and keep input_t still > around. As I showed you can implement input_t in terms of type_transformation_t, but as you wish. -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ |