Panda3D
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 
22 class 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  */
28 class EXPCL_PANDA_PSTATCLIENT PStatThread {
29 public:
30  INLINE PStatThread();
31 
32 PUBLISHED:
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 
48 private:
49  PStatClient *_client;
50  int _index;
51 
52 friend class PStatClient;
53 friend class PStatCollector;
54 };
55 
56 #include "pStatThread.I"
57 
58 #endif
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A lightweight class that represents a single element that may be timed and/or counted via stats.
Contains the raw timing and level data for a single frame.
A lightweight class that represents a single thread of execution to PStats.
Definition: pStatThread.h:28
A thread; that is, a lightweight process.
Definition: thread.h:46
Manages the communications to report statistics via a network connection to a remote PStatServer.
Definition: pStatClient.h:263
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.