Panda3D
pStatThread.cxx
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 pStatThread.cxx
10  * @author drose
11  * @date 2006-01-30
12  */
13 
14 #include "pStatThread.h"
15 #include "pStatClient.h"
16 #include "pStatClientImpl.h"
17 
18 /**
19  * This must be called at the start of every "frame", whatever a frame may be
20  * deemed to be, to accumulate all the stats that have collected so far for
21  * the thread and ship them off to the server.
22  *
23  * Calling PStatClient::thread_tick() will automatically call this for any
24  * threads with the indicated sync name.
25  */
26 void PStatThread::
28 #ifdef DO_PSTATS
29  _client->get_impl()->new_frame(_index);
30 #endif
31 }
32 
33 /**
34  * This is a slightly lower-level version of new_frame that also specifies the
35  * data to send for this frame.
36  */
37 void PStatThread::
38 add_frame(const PStatFrameData &frame_data) {
39 #ifdef DO_PSTATS
40  _client->get_impl()->add_frame(_index, frame_data);
41 #endif
42 }
43 
44 /**
45  * Returns the Panda Thread object associated with this particular
46  * PStatThread.
47  */
48 Thread *PStatThread::
49 get_thread() const {
50 #ifdef DO_PSTATS
51  return _client->get_thread_object(_index);
52 #else
53  return Thread::get_current_thread();
54 #endif
55 }
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Contains the raw timing and level data for a single frame.
A thread; that is, a lightweight process.
Definition: thread.h:46
void new_frame()
This must be called at the start of every "frame", whatever a frame may be deemed to be,...
Definition: pStatThread.cxx:27
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void add_frame(const PStatFrameData &frame_data)
This is a slightly lower-level version of new_frame that also specifies the data to send for this fra...
Definition: pStatThread.cxx:38