forked from panda3d/panda3d
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpStatFrameData.h
More file actions
78 lines (61 loc) · 1.94 KB
/
pStatFrameData.h
File metadata and controls
78 lines (61 loc) · 1.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/**
* PANDA 3D SOFTWARE
* Copyright (c) Carnegie Mellon University. All rights reserved.
*
* All use of this software is subject to the terms of the revised BSD
* license. You should have received a copy of this license along
* with this source code in a file named "LICENSE."
*
* @file pStatFrameData.h
* @author drose
* @date 2000-07-10
*/
#ifndef PSTATFRAMEDATA_H
#define PSTATFRAMEDATA_H
#include "pandabase.h"
#include "pnotify.h"
#include "pvector.h"
class Datagram;
class DatagramIterator;
class PStatClientVersion;
class PStatClient;
/**
* Contains the raw timing and level data for a single frame. This is a
* sequence of start/stop events, as well as a table of level values,
* associated with a number of collectors within a single frame.
*/
class EXPCL_PANDA_PSTATCLIENT PStatFrameData {
public:
INLINE bool is_time_empty() const;
INLINE bool is_level_empty() const;
INLINE bool is_empty() const;
INLINE void clear();
INLINE void swap(PStatFrameData &other);
INLINE void add_start(int index, double time);
INLINE void add_stop(int index, double time);
INLINE void add_level(int index, double level);
void sort_time();
INLINE double get_start() const;
INLINE double get_end() const;
INLINE double get_net_time() const;
INLINE size_t get_num_events() const;
INLINE int get_time_collector(size_t n) const;
INLINE bool is_start(size_t n) const;
INLINE double get_time(size_t n) const;
INLINE size_t get_num_levels() const;
INLINE int get_level_collector(size_t n) const;
INLINE double get_level(size_t n) const;
bool write_datagram(Datagram &destination, PStatClient *client) const;
void read_datagram(DatagramIterator &source, PStatClientVersion *version);
private:
class DataPoint {
public:
INLINE bool operator < (const DataPoint &other) const;
int _index;
double _value;
};
typedef pvector<DataPoint> Data;
Data _time_data, _level_data;
};
#include "pStatFrameData.I"
#endif