Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

TimedCycle Class Reference

A class for anything that needs to cycle over some finite list of elements in increments based on time. More...

#include <timedCycle.h>

List of all members.

Public Member Functions

 TimedCycle ()
 TimedCycle (float cycle_time, int element_count)
void set_element_count (int element_count)
 Set the number of elements being cycled through.

void set_cycle_time (float cycle_time)
 Set the number of elements being cycled through.

int next_element ()
 Set the number of elements being cycled through.

void write_datagram (Datagram &me)
 Writes the contents of this object to the datagram for shipping out to a Bam file.

void fillin (DatagramIterator &scan)
 This internal function is called by make_TimedCycle to read in all of the relevant data from the BamFile for the new TimedCycle.


Private Attributes

ClockObject_global_clock
float _cycle_time
float _inv_cycle_time
double _next_switch
int _current_child
int _element_count


Detailed Description

A class for anything that needs to cycle over some finite list of elements in increments based on time.

All time variables are assumed to be set in seconds.

Definition at line 51 of file timedCycle.h.


Constructor & Destructor Documentation

TimedCycle::TimedCycle  )  [inline]
 

Definition at line 30 of file timedCycle.I.

References _global_clock, and ClockObject::get_global_clock().

TimedCycle::TimedCycle float  cycle_time,
int  element_count
[inline]
 

Definition at line 48 of file timedCycle.I.

References _cycle_time, _global_clock, _inv_cycle_time, and _next_switch.


Member Function Documentation

void TimedCycle::fillin DatagramIterator scan  ) 
 

This internal function is called by make_TimedCycle to read in all of the relevant data from the BamFile for the new TimedCycle.

Definition at line 55 of file timedCycle.cxx.

int TimedCycle::next_element  )  [inline]
 

Set the number of elements being cycled through.

Definition at line 107 of file timedCycle.I.

void TimedCycle::set_cycle_time float  cycle_time  )  [inline]
 

Set the number of elements being cycled through.

Definition at line 82 of file timedCycle.I.

void TimedCycle::set_element_count int  element_count  )  [inline]
 

Set the number of elements being cycled through.

Definition at line 68 of file timedCycle.I.

References _cycle_time, _global_clock, _inv_cycle_time, _next_switch, ClockObject::get_frame_time(), INLINE, and nassertv.

void TimedCycle::write_datagram Datagram me  ) 
 

Writes the contents of this object to the datagram for shipping out to a Bam file.

Definition at line 37 of file timedCycle.cxx.

References _current_child, _cycle_time, _element_count, _global_clock, _inv_cycle_time, _next_switch, DatagramIterator::get_float32(), ClockObject::get_global_clock(), ClockObject::get_real_time(), and DatagramIterator::get_uint16().


Member Data Documentation

int TimedCycle::_current_child [private]
 

Definition at line 70 of file timedCycle.h.

Referenced by write_datagram().

float TimedCycle::_cycle_time [private]
 

Definition at line 67 of file timedCycle.h.

Referenced by set_element_count(), TimedCycle(), and write_datagram().

int TimedCycle::_element_count [private]
 

Definition at line 71 of file timedCycle.h.

Referenced by write_datagram().

ClockObject* TimedCycle::_global_clock [private]
 

Definition at line 66 of file timedCycle.h.

Referenced by set_element_count(), TimedCycle(), and write_datagram().

float TimedCycle::_inv_cycle_time [private]
 

Definition at line 68 of file timedCycle.h.

Referenced by set_element_count(), TimedCycle(), and write_datagram().

double TimedCycle::_next_switch [private]
 

Definition at line 69 of file timedCycle.h.

Referenced by set_element_count(), TimedCycle(), and write_datagram().


The documentation for this class was generated from the following files:
Generated on Fri May 2 00:55:39 2003 for Panda by doxygen1.3