00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef TIMED_CYCLE_H
00016 #define TIMED_CYCLE_H
00017
00018
00019
00020
00021 #include "pandabase.h"
00022
00023 #include "clockObject.h"
00024
00025 class Datagram;
00026 class DatagramIterator;
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 class EXPCL_PANDA_PUTIL TimedCycle
00037 {
00038 public:
00039 INLINE TimedCycle();
00040 INLINE TimedCycle(PN_stdfloat cycle_time, int element_count);
00041
00042 INLINE void set_element_count(int element_count);
00043 INLINE void set_cycle_time(PN_stdfloat cycle_time);
00044 INLINE int next_element();
00045
00046 public:
00047 void write_datagram(Datagram &me);
00048 void fillin(DatagramIterator &scan);
00049
00050 private:
00051 ClockObject* _global_clock;
00052 PN_stdfloat _cycle_time;
00053 PN_stdfloat _inv_cycle_time;
00054 double _next_switch;
00055 int _current_child;
00056 int _element_count;
00057 };
00058
00059 #include "timedCycle.I"
00060
00061 #endif