Panda3D
Loading...
Searching...
No Matches
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 */
27new_frame() {
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 */
38add_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 */
49get_thread() const {
50#ifdef DO_PSTATS
51 return _client->get_thread_object(_index);
52#else
54#endif
55}
Contains the raw timing and level data for a single frame.
get_thread
Returns the Panda Thread object associated with this particular PStatThread.
Definition pStatThread.h:45
void new_frame()
This must be called at the start of every "frame", whatever a frame may be deemed to be,...
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...
A thread; that is, a lightweight process.
Definition thread.h:46
get_current_thread
Returns a pointer to the currently-executing Thread object.
Definition thread.h:109
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.