Re: [pygccxml-development] [FT]input_t class - new vision.
Brought to you by:
mbaas,
roman_yakovenko
From: Matthias B. <ba...@ir...> - 2006-09-15 12:35:52
|
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. - Matthias - |