The interface for all device implementations.
See also Devices for a detailed description.
Public Member Functions | |
bool | Close () |
Closes a device. | |
virtual bool | GetType (eDeviceType &DeviceType) const =0 |
Returns the device type for the current object. | |
iDevice (const iDevice &device) | |
The copy constructor makes a copy of the existing device object. | |
bool | isOpen (bool &state) |
Returns the open state of a device object. | |
bool | Open (unsigned int Index=0) |
Opens a device. | |
iDevice & | operator= (const iDevice &device) |
The assignment operator makes a copy of the existing device object. | |
virtual | ~iDevice () |
Deletes the device object. |
VIB::iDevice::iDevice | ( | const iDevice & | device | ) |
The copy constructor makes a copy of the existing device object.
If the original object was created with Open(), a reference count is incremented to make sure that the device is only closed for the last copy of the object.
|
virtual |
Deletes the device object.
If the device was opened with Open(), it will be closed automatically if no duplicates of the objects exist.
bool VIB::iDevice::Close | ( | ) |
Closes a device.
The object must be in open state when calling this function.
After a device object is closed, the device can't be used until it's opened again.
Internally, a reference count is stored for each device to make sure that the device is only closed for the last copy of the object.
true
for success, use VIBSystem::GetLastErrorString() for an error description
|
pure virtual |
Returns the device type for the current object.
DeviceType | Device type eDeviceType |
true
for success, use VIBSystem::GetLastErrorString() for an error descriptionbool VIB::iDevice::isOpen | ( | bool & | state | ) |
Returns the open state of a device object.
state | State of the device, true if opened |
bool VIB::iDevice::Open | ( | unsigned int | Index = 0 | ) |
Opens a device.
The object must be in a closed state when calling this function.
See page Open devices using the Open() method for a detailed description.
Index | Device index across all hardware entities |
true
for success, use VIBSystem::GetLastErrorString() for an error descriptionThe assignment operator makes a copy of the existing device object.
If the original object was created with Open(), a reference count is incremented to make sure that the device is only closed for the last copy of the object.
If the device for the target object is open, it will be closed automatically before assigning the new object.