HALFRED
0.4.0
|
Overview.
The IOComposite device is a special kind of IODevice. It is used to simultaneously read and write to multiple other IODevices.
Creating and destroying composite IODevices.
In order to use IOComposite device it must be first created through a call to IOCOMPOSITE_Create. In the end the device should be destroyed by a complementary call to IOCOMPOSITE_Destroy. Both these functions use HEAP module for dynamic memory allocation.
Using composite IODevices.
The IOComposite device groups (associates) one ore more other IODevices. To associate an IODevice with the IOComposite device the IOCOMPOSITE_SetAssociation function is used. Here's an example.
Functions | |
IODevice | IOCOMPOSITE_Create (unsigned int max_associates) |
void | IOCOMPOSITE_Destroy (IODevice iocomposite) |
HALRESULT | IOCOMPOSITE_SetAssociation (IODevice iocomposite, unsigned int index, IODevice iodevice) |
HALRESULT | IOCOMPOSITE_ClearAssociation (IODevice iocomposite, unsigned int index) |
IODevice | IOCOMPOSITE_GetAssociation (IODevice iocomposite, unsigned int index) |
IODevice IOCOMPOSITE_Create | ( | unsigned int | max_associates | ) |
Creates a new IODevice, that reads and writes to multiple other IODevices.
max_associates | maximum number of associated IODevices |
void IOCOMPOSITE_Destroy | ( | IODevice | iocomposite | ) |
Destroys a composite IODevice and frees all memory allocated for it. This call does NOT destroy nor deinitialize associated IODevices. Note, that this function should NOT be used to free other types of IODevices.
iocomposite | IODevice handle of the IOComposite device |
HALRESULT IOCOMPOSITE_SetAssociation | ( | IODevice | iocomposite, |
unsigned int | index, | ||
IODevice | iodevice | ||
) |
Associates an IODevice to the IOComposite device under given index.
iocomposite | IODevice handle of the IOComposite device |
index | association index |
iodevice | IODevice handle to associate |
Clears association of an IODevice with the IOComposite device under given index.
iocomposite | IODevice handle of the IOComposite device |
index | association index |
Gets the IODevice associated with the IOComposite device under given index.
iocomposite | IODevice handle of the IOComposite device |
index | association index |