OSDL::CDROMDriveHandler Class Reference

#include <OSDLCDROMDriveHandler.h>

List of all members.


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 50 of file OSDLCDROMDriveHandler.h.


Public Member Functions

 CDROMDriveHandler () throw ( CDROMDriveException )
 Handler constructor.
virtual ~CDROMDriveHandler () throw ()
CDROMDrivegetCDROMDrive (CDROMDriveNumber number=0) throw ( CDROMDriveException )
 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 throw ()
 Returns an user-friendly description of the state of this drive manager.

Static Public Member Functions

static CDROMDriveNumber GetAvailableCDROMDrivesCount () throw ()
 Returns the number of CD-ROM drives attached to the system.

Private Member Functions

 CDROMDriveHandler (const CDROMDriveHandler &source) throw ()
 Copy constructor made private to ensure that it will be never called.
CDROMDriveHandleroperator= (const CDROMDriveHandler &source) throw ()
 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.

Constructor & Destructor Documentation

CDROMDriveHandler::CDROMDriveHandler (  )  throw ( CDROMDriveException )

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 50 of file OSDLCDROMDriveHandler.cc.

References OSDL::CommonModule::BackendSuccess, OSDL::Utils::getBackendLastError(), and OSDL::CommonModule::UseCDROM.

CDROMDriveHandler::~CDROMDriveHandler (  )  throw () [virtual]

Definition at line 77 of file OSDLCDROMDriveHandler.cc.

References _drives, and OSDL::CommonModule::UseCDROM.

OSDL::CDROMDriveHandler::CDROMDriveHandler ( const CDROMDriveHandler source  )  throw () [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 (  )  throw () [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 102 of file OSDLCDROMDriveHandler.cc.

Referenced by toString().

CDROMDrive & CDROMDriveHandler::getCDROMDrive ( CDROMDriveNumber  number = 0  )  throw ( CDROMDriveException )

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 118 of file OSDLCDROMDriveHandler.cc.

References _drives.

const std::string CDROMDriveHandler::toString ( Ceylan::VerbosityLevels  level = Ceylan::high  )  const throw () [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 157 of file OSDLCDROMDriveHandler.cc.

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

CDROMDriveHandler& OSDL::CDROMDriveHandler::operator= ( const CDROMDriveHandler source  )  throw () [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.


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 137 of file OSDLCDROMDriveHandler.h.

Referenced by getCDROMDrive(), toString(), and ~CDROMDriveHandler().


The documentation for this class was generated from the following files:

Generated on Fri Aug 1 14:46:10 2008 for OSDL by  doxygen 1.5.5