#NEWLINE# def _generate_func_serialize_stream_event_header( self , stream ) : #NEWLINE# #INDENT# self . _reset_per_func_state ( ) #NEWLINE# self . _generate_func_serialize_stream_event_header_proto ( stream ) #NEWLINE# tmpl = templates . _FUNC_SERIALIZE_STREAM_EVENT_HEADER_BODY_BEGIN #NEWLINE# self . _cg . add_lines ( tmpl ) #NEWLINE# self . _cg . indent ( ) #NEWLINE# if ( stream . event_header_type is not None ) : #NEWLINE# #INDENT# if ( 'timestamp' in stream . event_header_type . fields ) : #NEWLINE# #INDENT# timestamp = stream . event_header_type . fields [ 'timestamp' ] #NEWLINE# ts_ctype = self . _get_int_ctype ( timestamp ) #NEWLINE# clock = timestamp . property_mappings [ 0 ] . object #NEWLINE# clock_name = clock . name #NEWLINE# clock_ctype = clock . return_ctype #NEWLINE# tmpl = '{} ts = ctx->cbs.{}_clock_get_value(ctx->data);' #NEWLINE# self . _cg . add_line ( tmpl . format ( clock_ctype , clock_name ) ) #NEWLINE# #UNINDENT# #UNINDENT# self . _cg . add_empty_line ( ) #NEWLINE# func = self . _generate_func_serialize_event_from_entity #NEWLINE# if ( stream . event_header_type is not None ) : #NEWLINE# #INDENT# spec_src = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# if ( 'id' in stream . event_header_type . fields ) : #NEWLINE# #INDENT# id_t = stream . event_header_type . fields [ 'id' ] #NEWLINE# id_t_ctype = self . _get_int_ctype ( id_t ) #NEWLINE# spec_src [ 'id' ] = '({}) event_id' . format ( id_t_ctype ) #NEWLINE# #UNINDENT# if ( 'timestamp' in stream . event_header_type . fields ) : #NEWLINE# #INDENT# spec_src [ 'timestamp' ] = '({}) ts' . format ( ts_ctype ) #NEWLINE# #UNINDENT# func ( _PREFIX_SEH , stream . event_header_type , spec_src ) #NEWLINE# #UNINDENT# self . _cg . unindent ( ) #NEWLINE# tmpl = templates . _FUNC_SERIALIZE_STREAM_EVENT_HEADER_BODY_END #NEWLINE# self . _cg . add_lines ( tmpl )