DeviceManagement Class Reference

class caring about all powermanagable devices More...

#include <device_management.h>

List of all members.

Public Member Functions

 DeviceManagement ()
 constructor
void init ()
 init all devices
virtual ~DeviceManagement ()
 destructor resetting all devices to D0
bool suspend (DPM_DEVICE_CLASS device_class, int device_num=-1, bool force=false)
 suspend devices
bool resume (DPM_DEVICE_CLASS device_class, int device_num=-1)
 resume devices
bool update (std::list< DPM_DEVICE_CLASS > rpm_classes, bool force=false)
 updates the powerstate of all devices
int getDevices (DPM_DEVICE_CLASS device_class, std::list< std::string > &udis, std::list< DPM_POWER_STATE > &power_states)
 get list of stored devices
void addWlanDevice (const std::string &udi)
 add a wlan device
void addUsbDevice (const std::string &udi)
 add a usb device
void addSoundDevice (const std::string &udi)
 add a sound device
void addLanDevice (const std::string &udi)
 add a lan device
bool checkDeviceAdded (char *udi)
 check if an added device can be added to out device list
bool checkDeviceRemoved (char *udi)
 check if a removed device was one of our stored devices

Private Attributes

std::list< Device * > _devices
 list holding powermanagable devices


Detailed Description

class caring about all powermanagable devices


Constructor & Destructor Documentation

DeviceManagement::DeviceManagement  ) 
 

constructor

DeviceManagement::~DeviceManagement  )  [virtual]
 

destructor resetting all devices to D0


Member Function Documentation

void DeviceManagement::addLanDevice const std::string &  udi  ) 
 

add a lan device

Parameters:
udi the device udi to add

void DeviceManagement::addSoundDevice const std::string &  udi  ) 
 

add a sound device

Parameters:
udi the device udi to add

void DeviceManagement::addUsbDevice const std::string &  udi  ) 
 

add a usb device

Parameters:
udi the device udi to add

void DeviceManagement::addWlanDevice const std::string &  udi  ) 
 

add a wlan device

Parameters:
udi the device udi to add

bool DeviceManagement::checkDeviceAdded char *  udi  ) 
 

check if an added device can be added to out device list

Parameters:
udi the device udi
Returns:
true if the the device was added

bool DeviceManagement::checkDeviceRemoved char *  udi  ) 
 

check if a removed device was one of our stored devices

Parameters:
udi the device udi
Returns:
true if the device got remoced

int DeviceManagement::getDevices DPM_DEVICE_CLASS  device_class,
std::list< std::string > &  udis,
std::list< DPM_POWER_STATE > &  power_states
 

get list of stored devices

Parameters:
device_class get devices from this DPM_DEVICE_CLASS
udis stl list which get filled with udis
power_states stl list which get filled with power states
Returns:
number of devices

void DeviceManagement::init  ) 
 

init all devices

bool DeviceManagement::resume DPM_DEVICE_CLASS  device_class,
int  device_num = -1
 

resume devices

Parameters:
device_class resume only devices from this class
device_num only resume device device_num (default is -1, means resume all of this class)
Returns:
false if no devices where resumed

bool DeviceManagement::suspend DPM_DEVICE_CLASS  device_class,
int  device_num = -1,
bool  force = false
 

suspend devices

Parameters:
device_class suspend only devices from this class
device_num only suspend device device_num (default is -1, means suspend all of this class)
force set to true if devices should be suspended although they are in use
Returns:
false if no devices where suspended

bool DeviceManagement::update std::list< DPM_DEVICE_CLASS rpm_classes,
bool  force = false
 

updates the powerstate of all devices

function suspends those devices whos DPM_DEVICE_CLASS can be found in the given list rpm_classes. Devices not found are resumed

Parameters:
rpm_classes list of DPM_DEVICE_CLASS which should get suspended
force set to true if devices should be suspended although they are in use
Returns:
false if no devices where suspended


Member Data Documentation

std::list< Device* > DeviceManagement::_devices [private]
 

list holding powermanagable devices


The documentation for this class was generated from the following files:
Generated on Mon Mar 27 09:27:19 2006 for Powersave Daemon by  doxygen 1.4.6