Event Class Reference

class representing a powersave event like suspend2disk More...

#include <event.h>

List of all members.

Public Member Functions

 Event ()
 constructor
 Event (const string &n)
 copy constructor
 Event (const Event &)
 copy constructor
Eventoperator= (Event &)
 copy constructor
 ~Event ()
 destructor
bool execute_program (string acpi_event_line="")
 execute only one external program in the list of pending events
void setActions2Execute (std::list< std::string > actions)
 set the actions to be executed by this event
void setActions2Execute (const string &action)
 set an action to be executed by this event
bool isInternalAction ()
 checks whether the given action is internal
void setTimeout (unsigned long)
 sets the timeout of an event
unsigned long getTimeout ()
 gets the timeout of an event
void start ()
 starts the timer
void increaseSleeptime (unsigned long time)
 adds time to sleep_time
void setID (int id)
 sets the id of the event
int ID ()
 returns the event id
string name ()
 returns the event name
unsigned long timeElapsed ()
 returns the amount of time an event is running already
void setupInternalActions ()
 sets up the names of all internal actions
list< string >::iterator end ()
void insertAction (std::list< std::string > &actions, bool before, const std::string &match, const std::string &action)
 inserts an action into an event
std::string currentAction ()

Public Attributes

std::list< string >::iterator _current_program_2_execute
 an iterator which points to the current script in programs_2_execute
std::list< string > _programs_2_execute
 standard list containing all programs executed for an event

Static Public Attributes

static const int _proxy_nice_factor = -20
 giving the nicefactor with which they are acecuted

Private Attributes

string _name
 the unique name of an event
int _id
 a unique id, assigned by EventManagement
time_t _timeout
 the timeout in seconds before the event is considered as failed
long _starttime
 the starttime
unsigned long _sleep_time
 the time how long we slept while this event is running
std::list< string > _internalActions
 list of internal actions (e.g. throttle)


Detailed Description

class representing a powersave event like suspend2disk


Constructor & Destructor Documentation

Event::Event  ) 
 

constructor

Event::Event const string &  n  ) 
 

copy constructor

Event::Event const Event  ) 
 

copy constructor

Event::~Event  ) 
 

destructor


Member Function Documentation

string Event::currentAction  ) 
 

list< string >::iterator Event::end  ) 
 

bool Event::execute_program string  acpi_event_line = ""  ) 
 

execute only one external program in the list of pending events

I need a whole PM_Interface object here to get the current scheme name as a parameter for the invoked script and for internal actions, maybe this could be solved nicer ...

unsigned long Event::getTimeout  ) 
 

gets the timeout of an event

int Event::ID  ) 
 

returns the event id

void Event::increaseSleeptime unsigned long  time  ) 
 

adds time to sleep_time

void Event::insertAction std::list< std::string > &  actions,
bool  before,
const std::string &  match,
const std::string &  action
 

inserts an action into an event

Parameters:
actions the list which should be adjusted
before true if the actions should be inserted before the match
match the string to match where to insert the action
action the action to insert

bool Event::isInternalAction  ) 
 

checks whether the given action is internal

Returns:
integer value with result of the check
Return values:
1 if action is an internal action
-1 if not

string Event::name  ) 
 

returns the event name

Return values:
name of the event

Event & Event::operator= Event  ) 
 

copy constructor

void Event::setActions2Execute const string &  action  ) 
 

set an action to be executed by this event

Parameters:
action the action to be executed by this event

void Event::setActions2Execute std::list< std::string >  actions  ) 
 

set the actions to be executed by this event

Parameters:
actions slist containing the actions
Returns:
the execute variable as it used in config files.

void Event::setID int  id  ) 
 

sets the id of the event

void Event::setTimeout unsigned  long  ) 
 

sets the timeout of an event

void Event::setupInternalActions  ) 
 

sets up the names of all internal actions

void Event::start  ) 
 

starts the timer

unsigned long Event::timeElapsed  ) 
 

returns the amount of time an event is running already


Member Data Documentation

std::list< string >::iterator Event::_current_program_2_execute
 

an iterator which points to the current script in programs_2_execute

int Event::_id [private]
 

a unique id, assigned by EventManagement

std::list< string > Event::_internalActions [private]
 

list of internal actions (e.g. throttle)

string Event::_name [private]
 

the unique name of an event

std::list< string > Event::_programs_2_execute
 

standard list containing all programs executed for an event

this list contains all actions which should get executed for a specific even. It can contain scripts or internal actions

const int Event::_proxy_nice_factor = -20 [static]
 

giving the nicefactor with which they are acecuted

scripts are executed with negativ nice factor (higher priority) to avoid race conditions and provide fast suspend/standby maybe these should be configurable somewhen ...

unsigned long Event::_sleep_time [private]
 

the time how long we slept while this event is running

long Event::_starttime [private]
 

the starttime

time_t Event::_timeout [private]
 

the timeout in seconds before the event is considered as failed


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