#NEWLINE# def _generate_func_serialize_event( self , stream , event ) : #NEWLINE# #INDENT# self . _reset_per_func_state ( ) #NEWLINE# self . _generate_func_serialize_event_proto ( stream , event ) #NEWLINE# tmpl = templates . _FUNC_SERIALIZE_EVENT_BODY_BEGIN #NEWLINE# self . _cg . add_lines ( tmpl ) #NEWLINE# self . _cg . indent ( ) #NEWLINE# if ( stream . event_header_type is not None ) : #NEWLINE# #INDENT# t = stream . event_header_type #NEWLINE# exclude_list = [ 'timestamp' , 'id' ] #NEWLINE# params = self . _get_call_event_param_list_from_struct ( t , _PREFIX_SEH , exclude_list ) #NEWLINE# tmpl = '_serialize_stream_event_header_{sname}(ctx, {evid}{params});' #NEWLINE# self . _cg . add_cc_line ( 'stream event header' ) #NEWLINE# self . _cg . add_line ( tmpl . format ( sname = stream . name , evid = event . id , params = params ) ) #NEWLINE# self . _cg . add_empty_line ( ) #NEWLINE# #UNINDENT# if ( stream . event_context_type is not None ) : #NEWLINE# #INDENT# t = stream . event_context_type #NEWLINE# params = self . _get_call_event_param_list_from_struct ( t , _PREFIX_SEC , [ ] ) #NEWLINE# tmpl = '_serialize_stream_event_context_{sname}(ctx{params});' #NEWLINE# self . _cg . add_cc_line ( 'stream event context' ) #NEWLINE# self . _cg . add_line ( tmpl . format ( sname = stream . name , params = params ) ) #NEWLINE# self . _cg . add_empty_line ( ) #NEWLINE# #UNINDENT# if ( event . context_type is not None ) : #NEWLINE# #INDENT# self . _cg . add_cc_line ( 'event context' ) #NEWLINE# self . _generate_func_serialize_event_from_entity ( _PREFIX_EC , event . context_type ) #NEWLINE# #UNINDENT# if ( event . payload_type is not None ) : #NEWLINE# #INDENT# self . _cg . add_cc_line ( 'event payload' ) #NEWLINE# self . _generate_func_serialize_event_from_entity ( _PREFIX_EP , event . payload_type ) #NEWLINE# #UNINDENT# self . _cg . unindent ( ) #NEWLINE# tmpl = templates . _FUNC_SERIALIZE_EVENT_BODY_END #NEWLINE# self . _cg . add_lines ( tmpl )