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