Panda3D

pStatView.h
Go to the documentation of this file.
1 /**
2 * PANDA 3D SOFTWARE
3 * Copyright (c) Carnegie Mellon University. All rights reserved.
4 *
5 * All use of this software is subject to the terms of the revised BSD
6 * license. You should have received a copy of this license along
7 * with this source code in a file named "LICENSE."
8 *
9 * @file pStatView.h
10 * @author drose
11 * @date 2000-07-10
12 */
13
14 #ifndef PSTATVIEW_H
15 #define PSTATVIEW_H
16
17 #include "pandatoolbase.h"
18
19 #include "pStatClientData.h"
20 #include "pStatThreadData.h"
21 #include "pStatViewLevel.h"
22 #include "pmap.h"
23 #include "pointerTo.h"
24
25 /**
26 * A View boils down the frame data to a linear list of times spent in a
27 * number of different Collectors, within a particular thread. This
28 * automatically accounts for overlapping start/stop times and nested
29 * Collectors in a sensible way.
30 */
31 class PStatView {
32 public:
33 PStatView();
34 ~PStatView();
35
36 void constrain(int collector, bool show_level);
37 void unconstrain();
38
39 void set_thread_data(const PStatThreadData *thread_data);
40 INLINE const PStatThreadData *get_thread_data();
41 INLINE const PStatClientData *get_client_data();
42
43 void set_to_frame(const PStatFrameData &frame_data);
44 INLINE void set_to_frame(int frame_number);
45 INLINE void set_to_time(double time);
46
47 bool all_collectors_known() const;
48 double get_net_value() const;
49
50 const PStatViewLevel *get_top_level();
51
52 bool has_level(int collector) const;
53 PStatViewLevel *get_level(int collector);
54
55 INLINE bool get_show_level() const;
56 INLINE int get_level_index() const;
57
58 private:
59 void update_time_data(const PStatFrameData &frame_data);
60 void update_level_data(const PStatFrameData &frame_data);
61
62 void clear_levels();
63 bool reset_level(PStatViewLevel *level);
64
65 int _constraint;
66 bool _show_level;
67 bool _all_collectors_known;
68
69 typedef pmap<int, PStatViewLevel *> Levels;
70 Levels _levels;
71
72 int _level_index;
73
74 CPT(PStatClientData) _client_data;
75 CPT(PStatThreadData) _thread_data;
76 };
77
78 #include "pStatView.I"
79
80 #endif
PStatClientData
The data associated with a particular client, but not with any one particular frame or thread: the li...
Definition: pStatClientData.h:36
PStatFrameData
Contains the raw timing and level data for a single frame.
Definition: pStatFrameData.h:33
PStatThreadData
A collection of FrameData structures for recently-received frames within a particular thread.
Definition: pStatThreadData.h:34
PStatViewLevel
This is a single level value, or band of color, within a View.
Definition: pStatViewLevel.h:29
PStatView
A View boils down the frame data to a linear list of times spent in a number of different Collectors,...
Definition: pStatView.h:31
PStatView::get_level_index
int get_level_index() const
Returns an index number that can be used to determine when the set of known levels has changed.
Definition: pStatView.I:68
PStatView::get_net_value
double get_net_value() const
Returns the total value accounted for by the frame (or by whatever Collector we are constrained to).
Definition: pStatView.cxx:222
PStatView::get_top_level
const PStatViewLevel * get_top_level()
Returns a pointer to the level that corresponds to the Collector we've constrained to.
Definition: pStatView.cxx:239
PStatView::set_to_frame
void set_to_frame(const PStatFrameData &frame_data)
Supplies the View with the data for the current frame.
Definition: pStatView.cxx:194
PStatView::unconstrain
void unconstrain()
Restores the view to the full frame.
Definition: pStatView.cxx:168
PStatView::set_to_time
void set_to_time(double time)
Sets to the frame that occurred at the indicated time (or the nearest available frame),...
Definition: pStatView.I:49
PStatView::constrain
void constrain(int collector, bool show_level)
Changes the focus of the View.
Definition: pStatView.cxx:157
PStatView::get_show_level
bool get_show_level() const
Returns true if we are showing level data, false if time data.
Definition: pStatView.I:57
PStatView::get_thread_data
const PStatThreadData * get_thread_data()
Returns the current PStatThreadData associated with the view.
Definition: pStatView.I:19
PStatView::all_collectors_known
bool all_collectors_known() const
After a call to set_to_frame(), this returns true if all collectors in the FrameData are known by the...
Definition: pStatView.cxx:212
PStatView::has_level
bool has_level(int collector) const
Returns true if there is a level defined for the particular collector, false otherwise.
Definition: pStatView.cxx:248
PStatView::get_level
PStatViewLevel * get_level(int collector)
Returns a pointer to the level that corresponds to the indicated Collector.
Definition: pStatView.cxx:260
PStatView::get_client_data
const PStatClientData * get_client_data()
Returns the current PStatClientData associated with the view.
Definition: pStatView.I:28
pmap< int, PStatViewLevel * >
pStatClientData.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pStatThreadData.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pStatViewLevel.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pStatView.I
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pandatoolbase.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pmap.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pointerTo.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.