Introduce the notion of a Plug
commit88d4a8e6ffdbbe94e1db1f8fc5a2b5f7787adc50
authorAnthony Liguori <aliguori@us.ibm.com>
Fri, 12 Nov 2010 14:08:36 +0000 (12 08:08 -0600)
committerAnthony Liguori <aliguori@us.ibm.com>
Fri, 12 Nov 2010 14:08:36 +0000 (12 08:08 -0600)
tree1e049dbdd5d5f8221469de0ddde519d054983c9e
parenteb2d5c5b0ca63311716dfb6df07f4f645a95badc
Introduce the notion of a Plug

A plug stores a pointer to another device.  A plug can store a pointer to a
base class or it can store a pointer to a specific device type.  In the case
of the i8042, the controller only supports two types of devices and the devices
must occur on a specific port.

Besides providing for better marshalling support, a plug has NULL pointer
dereferencing checks built into it.  For the i8042, I need to update the code
to work properly with empty plugs.

Plugs need to be part of the factory interface.  So far we've been dealing with
non-optional devices that are constructed purely by composition.  Now that we
have optional devices, we need a generic way to instantiate the optional devices
and to attach them to the appropriate devices.
include/i8042.hpp
include/plug.hpp [new file with mode: 0644]
include/util.hpp
pc/i8042.cpp