A CD-ROM drive handler manages all CD-ROM device attached to the system, so they can be used easily and safely, by ensuring at most one CD-ROM drive object is associated to an actual device. More...
#include <OSDLCDROMDriveHandler.h>
Public Member Functions | |
CDROMDriveHandler () | |
Handler constructor. | |
virtual | ~CDROMDriveHandler () throw () |
CDROMDrive & | getCDROMDrive (CDROMDriveNumber number=0) |
Returns a CD-ROM drive object corresponding to the specified drive number, which will be automatically opened, if not already. | |
virtual const std::string | toString (Ceylan::VerbosityLevels level=Ceylan::high) const |
Returns an user-friendly description of the state of this drive manager. | |
Static Public Member Functions | |
static CDROMDriveNumber | GetAvailableCDROMDrivesCount () |
Returns the number of CD-ROM drives attached to the system. | |
Private Member Functions | |
CDROMDriveHandler (const CDROMDriveHandler &source) | |
Copy constructor made private to ensure that it will be never called. | |
CDROMDriveHandler & | operator= (const CDROMDriveHandler &source) |
Assignment operator made private to ensure that it will be never called. | |
Private Attributes | |
std::map< CDROMDriveNumber, CDROMDrive * > | _drives |
Keeps track of drive numbers, so no CD-ROM device can be linked to more than one CDROMDrive object. |
A CD-ROM drive handler manages all CD-ROM device attached to the system, so they can be used easily and safely, by ensuring at most one CD-ROM drive object is associated to an actual device.
Definition at line 80 of file OSDLCDROMDriveHandler.h.
CDROMDriveHandler::CDROMDriveHandler | ( | ) |
Handler constructor.
No CD-ROM drive specifically opened by this operation.
CDROMDriveException | if the CD-ROM subsystem could not be initialized. |
Definition at line 79 of file OSDLCDROMDriveHandler.cc.
References OSDL::CommonModule::BackendSuccess, OSDL::Utils::getBackendLastError(), and OSDL::CommonModule::UseCDROM.
CDROMDriveHandler::~CDROMDriveHandler | ( | ) | throw () [virtual] |
Definition at line 107 of file OSDLCDROMDriveHandler.cc.
References _drives, and OSDL::CommonModule::UseCDROM.
OSDL::CDROMDriveHandler::CDROMDriveHandler | ( | const CDROMDriveHandler & | source | ) | [explicit, private] |
Copy constructor made private to ensure that it will be never called.
The compiler should complain whenever this undefined constructor is called, implicitly or not.
CDROMDriveNumber CDROMDriveHandler::GetAvailableCDROMDrivesCount | ( | ) | [static] |
Returns the number of CD-ROM drives attached to the system.
If there is at least a CD-ROM drive, drive numbers are in [0,GetCDROMDrivesCount()-1].
Definition at line 132 of file OSDLCDROMDriveHandler.cc.
Referenced by toString().
CDROMDrive & CDROMDriveHandler::getCDROMDrive | ( | CDROMDriveNumber | number = 0 |
) |
Returns a CD-ROM drive object corresponding to the specified drive number, which will be automatically opened, if not already.
This handler enforces that each actual CD-ROM drive device is managed by at most one CDROMDrive object, hence getting multiple times the same drive number will always return the same instance.
number | the number of the drive to retrieve, which must be within [0;GetCDROMDrivesCount()-1]. The default value zero designates the default CD-ROM drive. |
CDROMDriveException | if specified drive number is not in licit range. |
Definition at line 149 of file OSDLCDROMDriveHandler.cc.
References _drives.
CDROMDriveHandler& OSDL::CDROMDriveHandler::operator= | ( | const CDROMDriveHandler & | source | ) | [private] |
Assignment operator made private to ensure that it will be never called.
The compiler should complain whenever this undefined operator is called, implicitly or not.
const std::string CDROMDriveHandler::toString | ( | Ceylan::VerbosityLevels | level = Ceylan::high |
) | const [virtual] |
Returns an user-friendly description of the state of this drive manager.
level | the requested verbosity level. |
Definition at line 188 of file OSDLCDROMDriveHandler.cc.
References _drives, GetAvailableCDROMDrivesCount(), and OSDL::Video::Pixels::toString().
std::map<CDROMDriveNumber, CDROMDrive *> OSDL::CDROMDriveHandler::_drives [private] |
Keeps track of drive numbers, so no CD-ROM device can be linked to more than one CDROMDrive object.
Definition at line 172 of file OSDLCDROMDriveHandler.h.
Referenced by getCDROMDrive(), toString(), and ~CDROMDriveHandler().