def emit(self, hfile, cfile): utils.add_separator(hfile, 'Struct', self.name); utils.add_separator(cfile, 'Struct', self.name); # Emit type self._emit_type(hfile) # Emit type's free self._emit_free(hfile, cfile) # Emit type's read self._emit_read(cfile) # Emit type's append self._emit_append(cfile)
def emit(self, hfile, cfile): utils.add_separator(hfile, 'Struct', self.name) utils.add_separator(cfile, 'Struct', self.name) # Emit type self._emit_type(hfile) # Emit type's free self._emit_free(hfile, cfile) # Emit type's read self._emit_read(cfile) # Emit type's append self._emit_append(cfile)
def emit(self, hfile, cfile, message_list): # Do nothing if no supported messages if len(message_list.indication_list) == 0 and len( message_list.request_list) == 0: self.__emit_supported(hfile, False) return self.__emit_supported(hfile, True) # First, emit common class code utils.add_separator(hfile, 'CLIENT', self.name) utils.add_separator(cfile, 'CLIENT', self.name) self.__emit_class(hfile, cfile, message_list) self.__emit_methods(hfile, cfile, message_list)
def emit(self, hfile, cfile): # First, emit the message/indication IDs enum self.emit_message_ids_enum(cfile) if self.indication_id_enum_name is not None: self.emit_indication_ids_enum(cfile) # Then, emit all message handlers for message in self.list: message.emit(hfile, cfile) # First, emit common class code utils.add_separator(hfile, 'Service-specific printable', self.service); utils.add_separator(cfile, 'Service-specific printable', self.service); self.__emit_get_printable(hfile, cfile) self.__emit_get_version_introduced(hfile, cfile)
def emit(self, hfile, cfile): # Always write build symbols, even for unsupported messages self.__emit_message_build_symbols(hfile) # Do nothing else if nothing in the supported lists if len(self.indication_list) == 0 and len(self.request_list) == 0: return # Emit the message/indication IDs enum and the build symbols self.__emit_message_ids_enum(cfile) if self.indication_id_enum_name is not None: self.__emit_indication_ids_enum(cfile) # Then, emit all message handlers for message in self.indication_list: message.emit(hfile, cfile) for message in self.request_list: message.emit(hfile, cfile) # First, emit common class code utils.add_separator(hfile, 'Service-specific utils', self.service) utils.add_separator(cfile, 'Service-specific utils', self.service) self.__emit_get_printable(hfile, cfile) self.__emit_is_abortable(hfile, cfile)
def emit(self, hfile, cfile): if self.type == 'Message': utils.add_separator(hfile, 'REQUEST/RESPONSE', self.fullname) utils.add_separator(cfile, 'REQUEST/RESPONSE', self.fullname) else: utils.add_separator(hfile, 'INDICATION', self.fullname) utils.add_separator(cfile, 'INDICATION', self.fullname) if self.type == 'Message': hfile.write('\n/* --- Input -- */\n') cfile.write('\n/* --- Input -- */\n') self.input.emit(hfile, cfile) self.__emit_request_creator(hfile, cfile) hfile.write('\n/* --- Output -- */\n') cfile.write('\n/* --- Output -- */\n') self.output.emit(hfile, cfile) self.__emit_helpers(hfile, cfile) self.__emit_response_or_indication_parser(hfile, cfile)
def emit(self, hfile, cfile): if self.type == 'Message': utils.add_separator(hfile, 'REQUEST/RESPONSE', self.fullname); utils.add_separator(cfile, 'REQUEST/RESPONSE', self.fullname); else: utils.add_separator(hfile, 'INDICATION', self.fullname); utils.add_separator(cfile, 'INDICATION', self.fullname); if self.type == 'Message': hfile.write('\n/* --- Input -- */\n'); cfile.write('\n/* --- Input -- */\n'); self.input.emit(hfile, cfile) self.__emit_request_creator(hfile, cfile) hfile.write('\n/* --- Output -- */\n'); cfile.write('\n/* --- Output -- */\n'); self.output.emit(hfile, cfile) self.__emit_helpers(hfile, cfile) self.__emit_response_or_indication_parser(hfile, cfile)
def emit(self, hfile, cfile, message_list): # First, emit common class code utils.add_separator(hfile, 'CLIENT', self.name) utils.add_separator(cfile, 'CLIENT', self.name) self.__emit_class(hfile, cfile, message_list) self.__emit_methods(hfile, cfile, message_list)
def emit(self, hfile, cfile): if self.has_query: utils.add_separator(hfile, 'Message (Query)', self.fullname); utils.add_separator(cfile, 'Message (Query)', self.fullname); self._emit_message_creator(hfile, cfile, 'query', self.query) if self.has_set: utils.add_separator(hfile, 'Message (Set)', self.fullname); utils.add_separator(cfile, 'Message (Set)', self.fullname); self._emit_message_creator(hfile, cfile, 'set', self.set) if self.has_response: utils.add_separator(hfile, 'Message (Response)', self.fullname); utils.add_separator(cfile, 'Message (Response)', self.fullname); self._emit_message_parser(hfile, cfile, 'response', self.response) if self.has_notification: utils.add_separator(hfile, 'Message (Notification)', self.fullname); utils.add_separator(cfile, 'Message (Notification)', self.fullname); self._emit_message_parser(hfile, cfile, 'notification', self.notification)
def emit(self, hfile, cfile, message_list): # First, emit common class code utils.add_separator(hfile, 'CLIENT', self.name); utils.add_separator(cfile, 'CLIENT', self.name); self.__emit_class(hfile, cfile, message_list) self.__emit_methods(hfile, cfile, message_list)