IMS2  Pre-Alpha
An Orbiter add-on to allow on-runtime construction of spacecraft from predefined modules
Event_Timed Class Reference

This is a base class for events that should fire after a set time interval in milliseconds instead of a framecount. More...

Inheritance diagram for Event_Timed:
Event_Base ShiftCGEvent

Public Member Functions

 Event_Timed (EVENTTYPE _type, unsigned int miliseconds)
 
- Public Member Functions inherited from Event_Base
 Event_Base (EVENTTYPE _type, unsigned int _delay=0)
 
EventHandlerGetCaller ()
 Returns the EventHandler at which this event originated.
 
virtual bool operator== (Event_Base *e)
 Compare whether two events are the same. More...
 
virtual bool operator!= (Event_Base *e)
 
virtual bool operator== (EVENTTYPE type)
 Allows to compare an event directly to an EVENTTYPE. More...
 
EVENTPIPE GetEventPipe ()
 

Protected Member Functions

virtual bool sendMe ()
 Checks how much time has elapsed since the creation of the event. More...
 

Private Attributes

unsigned long int creationtime
 stores the system time at which the event was created.
 

Additional Inherited Members

- Protected Attributes inherited from Event_Base
unsigned int delay
 How many calls of ProcessEvents() on the event generator the event should be delayed.
 
EventHandlercaller
 Stores the EventHandler at which the event originated.
 
EVENTTYPE eventtype
 The type of this event.
 
EVENTPIPE pipe
 The pipe the event travels in (unless it was relayed). This is set by the EventHandler itself.
 

Detailed Description

This is a base class for events that should fire after a set time interval in milliseconds instead of a framecount.

This still assumes that an event generator will check the event every frame. The event won't send itself just because it exists!

Note
: Though time can be defined in miliseconds, the interval will not be sent at milisecond precision. It is not asynchronous and the precision of the timer very much depends on the framerate, so don't use this to control precision-critical operations!
The event counts system time, not sim time, and will therefore be unaffected by time acceleration.
See also
EventHandler.h

Constructor & Destructor Documentation

Event_Timed::Event_Timed ( EVENTTYPE  _type,
unsigned int  miliseconds 
)
Parameters
_typeThe event type of this event
milisecondsIn how many miliseconds the event should fire

Member Function Documentation

bool Event_Timed::sendMe ( )
protectedvirtual

Checks how much time has elapsed since the creation of the event.

Returns
True if the set interval has passed, false otherwise

Reimplemented from Event_Base.


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