然后构造函数打印出一条警告消息指明没有回调函数,因为列表是不可变的,所以我们没有机会用一个新的值来替代现有的回调函数列表。
The constructor then prints a warning message that there are no callbacks, since lists are immutable and there is no way to replace the callback list val with a new one.
virtio_driver 结构定义上层设备驱动程序、驱动程序支持的设备 ID 的列表、一个特性表单(取决于设备类型)和一个回调函数列表。
The virtio_driver structure defines the upper-level device driver, list of device IDs that the driver supports, a features table (dependent upon the device type), and a list of callback functions.
主构造函数,类的主题,有一个参数列表来接受标签字符串和回调函数的列表。
The primary constructor, which is the body of the entire class, has a parameter list that takes a label string and a list of callback functions.
应用推荐