Sourceforge.net - The VCF's Project Host
   The VCF Website Home   |   Online Discussion Forums   |   Sourceforge.net Project Page   

VCF::TimerComponent Class Reference

The TimerComponent is used to fire timer events. More...

#include <vcf/ApplicationKit/TimerComponent.h>

Inheritance diagram for VCF::TimerComponent:

VCF::Component VCF::ObjectWithEvents VCF::Object List of all members.

Public Member Functions

 TimerComponent ()
 TimerComponent (Component *owner)
 TimerComponent (const String &name, Component *owner)
 TimerComponent (const String &name)
virtual ~TimerComponent ()
virtual void afterCreate (ComponentEvent *event)
 after the component has been created/instantiated the afterCreate() method is called.
bool isActive ()
 Indicates whether or not the component is active.
void setActivated (const bool &isActive)
 Activates the timer.
int32 getTimeoutInterval ()
 Returns the time out interval in milliseconds.
void setTimeoutInterval (const int32 &interval)
 Set's the time out interval.

Public Attributes

VCF::Delegate TimerActivated
VCF::Delegate TimerDeactivated
VCF::Delegate TimerPulse

Protected Member Functions

void onInternalTimerPulse (TimerEvent *event)
EventHandlergetTimerHandler ()

Protected Attributes

bool isActive_
int32 timeoutInterval_

Detailed Description

The TimerComponent is used to fire timer events.

Simply create the component, add an event handler to it's TimerPulse delegate, set it's time out interval, and activate the timer. You can stop the timer at any point by call it's setActivated() function and passing in false. The default state of the timer is not active.


Constructor & Destructor Documentation

VCF::TimerComponent::TimerComponent  ) 
 

VCF::TimerComponent::TimerComponent Component owner  ) 
 

VCF::TimerComponent::TimerComponent const String name,
Component owner
 

VCF::TimerComponent::TimerComponent const String name  ) 
 

virtual VCF::TimerComponent::~TimerComponent  )  [virtual]
 


Member Function Documentation

virtual void VCF::TimerComponent::afterCreate ComponentEvent event  )  [virtual]
 

after the component has been created/instantiated the afterCreate() method is called.

Special initializations may then happen here.

Reimplemented from VCF::Component.

int32 VCF::TimerComponent::getTimeoutInterval  )  [inline]
 

Returns the time out interval in milliseconds.

EventHandler* VCF::TimerComponent::getTimerHandler  )  [protected]
 

bool VCF::TimerComponent::isActive  )  [inline]
 

Indicates whether or not the component is active.

The timer is considered active if it is firing timer events. It will remain active till it's destroyed, or setActive() is called with false for a value.

void VCF::TimerComponent::onInternalTimerPulse TimerEvent event  )  [protected]
 

void VCF::TimerComponent::setActivated const bool &  isActive  ) 
 

Activates the timer.

Pass in true to activate the timer, and false to turn it off. If the timer is activated, it will start to fire timer events.

void VCF::TimerComponent::setTimeoutInterval const int32 interval  ) 
 

Set's the time out interval.

A new timer event, i.e. TimerPulse will fire an event, ever interval number of milliseconds.


Member Data Documentation

bool VCF::TimerComponent::isActive_ [protected]
 

int32 VCF::TimerComponent::timeoutInterval_ [protected]
 

VCF::Delegate VCF::TimerComponent::TimerActivated
 

VCF::Delegate VCF::TimerComponent::TimerDeactivated
 

VCF::Delegate VCF::TimerComponent::TimerPulse
 


The documentation for this class was generated from the following file:
   Comments or Suggestions?    License Information