Project stdui: "Simple Type Dialog User-Interface"

|
Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

control::ctimer Class Reference

#include <ctimer.hxx>

Inheritance diagram for control::ctimer:

Inheritance graph
[legend]
Collaboration diagram for control::ctimer:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ctimer (const std::string &nameid, const sigc::slot< bool > &exec_hook)
 ctimer ()
virtual ~ctimer ()
bool pause ()
virtual bool start (unsigned long delay, bool once=false)
bool resume ()
void stop ()
virtual bool controller_loop ()

Protected Attributes

unsigned long _duration
bool _single_shot

Detailed Description

Author:
Serge Lussier

Definition at line 31 of file ctimer.hxx.


Constructor & Destructor Documentation

control::ctimer::ctimer const std::string &  nameid,
const sigc::slot< bool > &  exec_hook
 

Definition at line 24 of file ctimer.cc.

References control::ccontrol::init().

00024                                                                         : ccontrol(nameid, sigc::mem_fun<bool>(this, &ccontrol::noop) )
00025 {
00026    _state = ::control::pause;
00027    init();
00028 }

Here is the call graph for this function:

control::ctimer::ctimer  ) 
 

Definition at line 31 of file ctimer.cc.

References control::ccontrol::init().

00031               : ccontrol()
00032 {
00033    init();
00034 }

Here is the call graph for this function:

control::ctimer::~ctimer  )  [virtual]
 

Definition at line 37 of file ctimer.cc.

00038 {
00039 }


Member Function Documentation

bool control::ctimer::controller_loop  )  [virtual]
 

Reimplemented from control::ccontrol.

Definition at line 90 of file ctimer.cc.

References _duration, _single_shot, stop(), and control::ccontrol::wait().

00091 {
00092    do{
00093       switch(_state){
00094          case ::control::proceed:
00095             usleep( _duration );
00096             cthread::notify();
00097             if( _single_shot) stop();
00098             break;
00099          case ::control::terminate:
00100             return false;
00101          case ::control::pause:
00102             do  wait(); while(_state == ::control::pause );
00103             break;
00104       }
00105    }while(_state != ::control::terminate );
00106    return true;
00107 }

Here is the call graph for this function:

bool control::ctimer::pause  ) 
 

Definition at line 48 of file ctimer.cc.

00049 {
00050    _state = ::control::pause;
00051    return true;
00052 }

bool control::ctimer::resume  ) 
 

Definition at line 70 of file ctimer.cc.

00071 {
00072    _state = control::proceed;
00073    ccontrol::signal();
00074    return true;
00075 }

bool control::ctimer::start unsigned long  delay,
bool  once = false
[virtual]
 

Definition at line 58 of file ctimer.cc.

References _duration, and _single_shot.

00059 {
00060    _duration = delay;
00061    _state = ::control::proceed;
00062    _single_shot = once;
00063    return ccontrol::start();
00064 }

void control::ctimer::stop  ) 
 

Definition at line 81 of file ctimer.cc.

Referenced by controller_loop().

00082 {
00083    _state = ::control::pause;
00084 }


Member Data Documentation

unsigned long control::ctimer::_duration [protected]
 

Definition at line 47 of file ctimer.hxx.

Referenced by controller_loop(), and start().

bool control::ctimer::_single_shot [protected]
 

Definition at line 48 of file ctimer.hxx.

Referenced by controller_loop(), and start().


The documentation for this class was generated from the following files:
API Documentation Generated by:  doxygen 1.4.0
About the author | Site started with trial version of DreamWeaver MX 2004 | Finalizing with  | Contact | ©2005, Serge Lussier ( Bretzel )