20 return _time_data.empty();
29 return _level_data.empty();
55 _time_data.swap(other._time_data);
56 _level_data.swap(other._level_data);
65 nassertv((index & 0x7fff) == index);
70 _time_data.push_back(dp);
79 nassertv((index & 0x7fff) == index);
82 dp._index = index | 0x8000;
84 _time_data.push_back(dp);
94 nassertv((index & 0xffff) == index);
99 _level_data.push_back(dp);
112 return _time_data.front()._value;
123 return _time_data.back()._value;
133 return _time_data.back()._value - _time_data.front()._value;
141 return _time_data.size();
149 nassertr(n < _time_data.size(), 0);
150 return _time_data[n]._index & 0x7fff;
159 nassertr(n < _time_data.size(), 0);
160 return (_time_data[n]._index & 0x8000) == 0;
170 nassertr(n < _time_data.size(), 0);
171 return _time_data[n]._value;
179 return _level_data.size();
187 nassertr(n < _level_data.size(), 0);
188 return _level_data[n]._index;
196 nassertr(n < _level_data.size(), 0);
197 return _level_data[n]._value;
203 INLINE
bool PStatFrameData::DataPoint::
204 operator < (
const PStatFrameData::DataPoint &other)
const {
205 return _value < other._value;
Contains the raw timing and level data for a single frame.
void swap(PStatFrameData &other)
Exchanges the data in this object with the data in the other.
bool is_empty() const
Returns true if the FrameData has no time or level data.
double get_end() const
Returns the time of the last data point in the frame data.
double get_time(size_t n) const
Returns the timestamp of the nth event, in seconds elapsed since some undefined epoch (which is guara...
int get_time_collector(size_t n) const
Returns the index of the collector associated with the nth event.
size_t get_num_levels() const
Returns the number of individual level values stored in the FrameData.
bool is_start(size_t n) const
Returns true if the nth event represents a start event, or false if it represents a stop event.
double get_net_time() const
Returns the total time elapsed for the frame.
double get_start() const
Returns the time of the first data point in the frame data.
size_t get_num_events() const
Returns the number of individual events stored in the FrameData.
bool is_time_empty() const
Returns true if there are no time events in the frame data, false otherwise.
void add_level(int index, double level)
Adds a particular level value associated with a given collector to the frame data.
double get_level(size_t n) const
Returns the height of the nth level value.
void add_stop(int index, double time)
Adds a 'stop collector' data point to the frame data.
bool is_level_empty() const
Returns true if there are no levels indicated in the frame data, false otherwise.
void clear()
Removes all the data points from the frame data, in preparation for building up a new frame's worth.
int get_level_collector(size_t n) const
Returns the index of the collector associated with the nth level value.
void add_start(int index, double time)
Adds a 'start collector' data point to the frame data.