adevs
Classes | Public Member Functions | Protected Member Functions | List of all members
adevs::QemuDeviceModel Class Referenceabstract

#include <adevs_qemu.h>

Inheritance diagram for adevs::QemuDeviceModel:
adevs::QemuNic adevs::QemuSerialPort adevs::uCsimSerialPort

Classes

class  io_buffer
 

Public Member Functions

int num_bytes_to_read ()
 
void read_bytes (void *buf)
 
virtual void write_bytes (void *data, int num_bytes)=0
 
virtual void append_qemu_arguments (std::vector< std::string > &args)=0
 
void read_loop ()
 
void init_func ()
 

Protected Member Functions

void start ()
 
virtual io_bufferread ()=0
 
virtual void initialize_io_structures ()=0
 

Detailed Description

This is the interface to be implemented by all device models that will be encapsulated in a model of the computer. The interface is written from the perspective of a person outside the computer.

Member Function Documentation

virtual void adevs::QemuDeviceModel::append_qemu_arguments ( std::vector< std::string > &  args)
pure virtual

Arguments to be appended to the qemu argument vector when qemu is forked to simulate the computer.

Implemented in adevs::uCsimSerialPort, adevs::QemuSerialPort, and adevs::QemuNic.

int adevs::QemuDeviceModel::num_bytes_to_read ( )

Returns the number of bytes available to be read from the device. For message oriented devices, this will be the size of the next message (e.g., an ethernet frame).

void adevs::QemuDeviceModel::read_bytes ( void *  buf)

Copy the available data to the supplied buffer.

virtual void adevs::QemuDeviceModel::write_bytes ( void *  data,
int  num_bytes 
)
pure virtual

Cause data to arrive at the external, physical port. This call will block if the corresponding write to the underlying file descriptor blocks.

Implemented in adevs::uCsimSerialPort, adevs::QemuSerialPort, and adevs::QemuNic.


The documentation for this class was generated from the following file: