00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef PSTATFRAMEDATA_H
00020 #define PSTATFRAMEDATA_H
00021
00022 #include <pandabase.h>
00023
00024 #include <notify.h>
00025
00026 #include "pvector.h"
00027
00028 class Datagram;
00029 class DatagramIterator;
00030 class PStatClientVersion;
00031
00032
00033
00034
00035
00036
00037
00038
00039 class EXPCL_PANDA PStatFrameData {
00040 public:
00041 INLINE bool is_time_empty() const;
00042 INLINE bool is_level_empty() const;
00043 INLINE bool is_empty() const;
00044 INLINE void clear();
00045
00046 INLINE void add_start(int index, float time);
00047 INLINE void add_stop(int index, float time);
00048 INLINE void add_level(int index, float level);
00049
00050 INLINE float get_start() const;
00051 INLINE float get_end() const;
00052 INLINE float get_net_time() const;
00053
00054 INLINE int get_num_events() const;
00055 INLINE int get_time_collector(int n) const;
00056 INLINE bool is_start(int n) const;
00057 INLINE float get_time(int n) const;
00058
00059 INLINE int get_num_levels() const;
00060 INLINE int get_level_collector(int n) const;
00061 INLINE float get_level(int n) const;
00062
00063 void write_datagram(Datagram &destination) const;
00064 void read_datagram(DatagramIterator &source, PStatClientVersion *version);
00065
00066 private:
00067 class DataPoint {
00068 public:
00069 int _index;
00070 float _value;
00071 };
00072 typedef pvector<DataPoint> Data;
00073
00074 Data _time_data, _level_data;
00075 };
00076
00077 #include "pStatFrameData.I"
00078
00079 #endif
00080