Panda3D
Loading...
Searching...
No Matches
pStatThread.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 pStatThread.h
10 * @author drose
11 * @date 2000-07-11
12 */
13
14#ifndef PSTATTHREAD_H
15#define PSTATTHREAD_H
16
17#include "pandabase.h"
18
19#include "pStatClient.h"
20#include "pStatFrameData.h"
21
22class Thread;
23
24/**
25 * A lightweight class that represents a single thread of execution to PStats.
26 * It corresponds one-to-one with Panda's Thread instance.
27 */
28class EXPCL_PANDA_PSTATCLIENT PStatThread {
29public:
30 INLINE PStatThread();
31
32PUBLISHED:
33 INLINE PStatThread(PStatClient *client, int index);
34 INLINE PStatThread(Thread *thread, PStatClient *client = nullptr);
35
36 INLINE PStatThread(const PStatThread &copy);
37 INLINE void operator = (const PStatThread &copy);
38
39 void new_frame();
40 void add_frame(const PStatFrameData &frame_data);
41
42 Thread *get_thread() const;
43 INLINE int get_index() const;
44
45 MAKE_PROPERTY(thread, get_thread);
46 MAKE_PROPERTY(index, get_index);
47
48public:
49 PStatClient *get_client() const;
50
51private:
52 PStatClient *_client;
53 int _index;
54
55friend class PStatClient;
56friend class PStatCollector;
57};
58
59#include "pStatThread.I"
60
61#endif
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
get_index
Returns the index number of this particular thread within the PStatClient.
Definition pStatThread.h:46
void new_frame()
This must be called at the start of every "frame", whatever a frame may be deemed to be,...
PStatThread()
Normally, this constructor is called only from PStatClient.
Definition pStatThread.I:19
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
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.