#NEWLINE# def _generate_func_serialize_event_from_entity( self , prefix , t , spec_src = None ) : #NEWLINE# #INDENT# self . _cg . add_line ( '{' ) #NEWLINE# self . _cg . indent ( ) #NEWLINE# self . _cg . add_cc_line ( 'align structure' ) #NEWLINE# self . _sasa . reset ( ) #NEWLINE# self . _generate_align_type ( 'ctx->at' , t ) #NEWLINE# for ( field_name , field_type ) in t . fields . items ( ) : #NEWLINE# #INDENT# src = ( prefix + field_name ) #NEWLINE# if ( src is not None ) : #NEWLINE# #INDENT# if ( field_name in spec_src ) : #NEWLINE# #INDENT# src = spec_src [ field_name ] #NEWLINE# #UNINDENT# #UNINDENT# self . _cg . add_empty_line ( ) #NEWLINE# self . _generate_field_name_cc_line ( field_name ) #NEWLINE# self . _generate_align_type ( 'ctx->at' , field_type ) #NEWLINE# self . _generate_serialize_type ( src , 'ctx' , field_type ) #NEWLINE# #UNINDENT# self . _cg . unindent ( ) #NEWLINE# self . _cg . add_line ( '}' ) #NEWLINE# self . _cg . add_empty_line ( )