1 | /* |
2 | * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. |
3 | * |
4 | * NVIDIA CORPORATION and its licensors retain all intellectual property |
5 | * and proprietary rights in and to this software, related documentation |
6 | * and any modifications thereto. Any use, reproduction, disclosure or |
7 | * distribution of this software and related documentation without an express |
8 | * license agreement from NVIDIA CORPORATION is strictly prohibited. |
9 | */ |
10 | #ifndef PVD_CONNECTION_H |
11 | #define PVD_CONNECTION_H |
12 | #include "physxvisualdebuggersdk/PvdConnectionFlags.h" |
13 | |
14 | namespace physx { namespace debugger { |
15 | class PvdNetworkOutStream; |
16 | }} |
17 | |
18 | namespace physx { namespace debugger { namespace renderer { |
19 | class PvdUserRenderer; |
20 | }}} |
21 | |
22 | namespace physx { namespace debugger { namespace comm { |
23 | |
24 | class PvdMetaDataStream; |
25 | class PvdDataStream; |
26 | |
27 | class PvdConnection |
28 | { |
29 | protected: |
30 | virtual ~PvdConnection(){} |
31 | public: |
32 | virtual void addRef() = 0; |
33 | virtual void release() = 0; |
34 | |
35 | //A data stream is not threadsafe, although you can use multiple |
36 | //data streams, each used from only one thread at a one time safely. |
37 | //Their shared socket communication, in other words, is threadsafe. |
38 | virtual PvdDataStream& createDataStream() = 0; |
39 | |
40 | //Create a channel to render immediate data on PVD. Rendering is collected |
41 | //per frame and then discared. A line is only draw for the frame |
42 | //in which it was received. |
43 | virtual renderer::PvdUserRenderer& createRenderer() = 0; |
44 | |
45 | //May actively change during debugging. |
46 | //Getting this variable may block until the read thread |
47 | //is disconnected or releases the connection state mutex. |
48 | virtual PvdConnectionState::Enum getConnectionState() = 0; |
49 | |
50 | //gets the connection state which will block if the system is paused. |
51 | //checks the connection for errors and disconnects if there are any. |
52 | virtual void checkConnection() = 0; |
53 | |
54 | //Will currently never change during debugging |
55 | virtual TConnectionFlagsType getConnectionType() = 0; |
56 | |
57 | virtual bool isConnected() = 0; |
58 | virtual void disconnect() = 0; |
59 | //flush profile and memory data. |
60 | //This does not flush the socket for performance reasons. |
61 | virtual void flush() = 0; |
62 | |
63 | //Connections *always* have an out stream, although they may not |
64 | //have an *in* stream. |
65 | virtual PvdNetworkOutStream& lockOutStream() = 0; |
66 | virtual void unlockOutStream() = 0; |
67 | }; |
68 | |
69 | }} |
70 | |
71 | |
72 | /** \brief Convenience typedef for the PvdConnection. */ |
73 | typedef debugger::comm::PvdConnection PxVisualDebuggerConnection; |
74 | } |
75 | #endif |
76 | |