#include <device_container.hpp>


Public Types | |
| typedef DeviceT | device_type |
| typedef vector< DeviceT * > | collection_type |
|
typedef collection_type::const_iterator | const_iterator |
Public Member Functions | |
| device_container (int max_devices=0, bool dense=true) | |
| virtual const_iterator | begin (void) const |
| Returns the begin iterator (const variant). | |
| virtual const_iterator | end (void) const |
| Returns the end iterator (const variant). | |
| virtual int | register_device (DeviceT *device) |
| Registers the device at this container, which becomes the new owner. | |
| virtual int | unregister_device (const DeviceT *device) |
| Unregisters the device, transferring ownership back to the caller. | |
| virtual int | reset_devices (void) |
| Resets all registered devices as when powering up the machine. | |
Protected Attributes | |
| const int | max_devices |
| Maximum number of devices that can be handled. | |
| const bool | dense |
| If true, keep the registered devices dense. | |
| collection_type | devices |
| Vector storing (pointers to) the registered devices. | |
| int | num_devices |
| Number of currently registered devices. | |
Frees all registered devices during destruction.
const int device_container< DeviceT >::max_devices [protected] |
Maximum number of devices that can be handled.
A value of 0 denotes no limit.
Referenced by device_container< DeviceT >::register_device().
const bool device_container< DeviceT >::dense [protected] |
If true, keep the registered devices dense.
That is use erase to unregister a device, causing the following devices to move down. Otherwise overwrite with NULL. Thus the following devices keep their position.
Referenced by device_container< DeviceT >::unregister_device().