OSDL::CDROMDriveHandler Class Reference

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>

Collaboration diagram for OSDL::CDROMDriveHandler:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 CDROMDriveHandler ()
 Handler constructor.
virtual ~CDROMDriveHandler () throw ()
CDROMDrivegetCDROMDrive (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.
CDROMDriveHandleroperator= (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.

Detailed Description

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.


Constructor & Destructor Documentation

CDROMDriveHandler::CDROMDriveHandler (  ) 

Handler constructor.

No CD-ROM drive specifically opened by this operation.

Exceptions:
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.


Member Function Documentation

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.

Parameters:
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.
Exceptions:
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.

Parameters:
level the requested verbosity level.
Note:
Text output format is determined from overall settings.
See also:
Ceylan::TextDisplayable

Definition at line 188 of file OSDLCDROMDriveHandler.cc.

References _drives, GetAvailableCDROMDrivesCount(), and OSDL::Video::Pixels::toString().


Member Data Documentation

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().


The documentation for this class was generated from the following files:
Generated on Mon Nov 29 14:05:26 2010 for OSDL by  doxygen 1.6.3