RavEngine
Loading...
Searching...
No Matches
OmniPvdReaderImpl.h
1// Redistribution and use in source and binary forms, with or without
2// modification, are permitted provided that the following conditions
3// are met:
4// * Redistributions of source code must retain the above copyright
5// notice, this list of conditions and the following disclaimer.
6// * Redistributions in binary form must reproduce the above copyright
7// notice, this list of conditions and the following disclaimer in the
8// documentation and/or other materials provided with the distribution.
9// * Neither the name of NVIDIA CORPORATION nor the names of its
10// contributors may be used to endorse or promote products derived
11// from this software without specific prior written permission.
12//
13// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
14// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
17// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24//
25// Copyright (c) 2008-2022 NVIDIA Corporation. All rights reserved.
26// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
27// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
28
29#ifndef OMNI_PVD_RUNTIME_READER_IMPL_H
30#define OMNI_PVD_RUNTIME_READER_IMPL_H
31
32#include "OmniPvdReader.h"
33#include "OmniPvdLog.h"
34
36public:
39
40 void OMNI_PVD_CALL setLogFunction(OmniPvdLogFunction logFunction);
41 void OMNI_PVD_CALL setReadStream(OmniPvdReadStream* stream);
42 bool OMNI_PVD_CALL startReading(OmniPvdVersionType* majorVersion, OmniPvdVersionType* minorVersion, OmniPvdVersionType* patch);
43 OmniPvdCommandEnum::Enum OMNI_PVD_CALL getNextCommand();
44 OmniPvdCommandEnum::Enum OMNI_PVD_CALL getCommandType();
45
46 OmniPvdVersionType OMNI_PVD_CALL getMajorVersion();
47 OmniPvdVersionType OMNI_PVD_CALL getMinorVersion();
48 OmniPvdVersionType OMNI_PVD_CALL getPatch();
49
50 OmniPvdContextHandle OMNI_PVD_CALL getContextHandle();
51 OmniPvdObjectHandle OMNI_PVD_CALL getObjectHandle();
52
53 OmniPvdClassHandle OMNI_PVD_CALL getClassHandle();
54 OmniPvdClassHandle OMNI_PVD_CALL getBaseClassHandle();
55 OmniPvdAttributeHandle OMNI_PVD_CALL getAttributeHandle();
56
57 char* OMNI_PVD_CALL getClassName();
58 char* OMNI_PVD_CALL getAttributeName();
59 char* OMNI_PVD_CALL getObjectName();
60
61 uint8_t* OMNI_PVD_CALL getAttributeDataPointer();
62 OmniPvdAttributeDataType OMNI_PVD_CALL getAttributeDataType();
63 uint32_t OMNI_PVD_CALL getAttributeDataLength();
64 uint32_t OMNI_PVD_CALL getAttributeNumberElements();
65 OmniPvdClassHandle OMNI_PVD_CALL getAttributeClassHandle();
66
67 uint8_t OMNI_PVD_CALL getAttributeNumberHandles();
68 OmniPvdAttributeHandle* OMNI_PVD_CALL getAttributeHandles();
69
70 uint64_t OMNI_PVD_CALL getFrameTimeStart();
71 uint64_t OMNI_PVD_CALL getFrameTimeStop();
72
73 OmniPvdClassHandle OMNI_PVD_CALL getEnumClassHandle();
74 uint32_t OMNI_PVD_CALL getEnumValue();
75
76 // Internal helper
77 void readLongDataFromStream(uint32_t streamByteLen);
78
79 OmniPvdLog mLog;
80
81 OmniPvdReadStream *mStream;
82
83 OmniPvdVersionType mMajorVersion;
84 OmniPvdVersionType mMinorVersion;
85 OmniPvdVersionType mPatch;
86
87 OmniPvdCommandEnum::Enum mCmdType;
88
89 OmniPvdVersionType mCmdMajorVersion;
90 OmniPvdVersionType mCmdMinorVersion;
91 OmniPvdVersionType mCmdPatch;
92
93 OmniPvdContextHandle mCmdContextHandle;
94 OmniPvdObjectHandle mCmdObjectHandle;
95
96 uint32_t mCmdClassHandle;
97 uint32_t mCmdBaseClassHandle;
98 uint32_t mCmdAttributeHandle;
99
101 // TODO : take care of buffer length limit at read time!
103 char mCmdClassName[1000];
104 char mCmdAttributeName[1000];
105 char mCmdObjectName[1000];
106
107 uint16_t mCmdClassNameLen;
108 uint16_t mCmdAttributeNameLen;
109 uint16_t mCmdObjectNameLen;
110
111 uint8_t* mCmdAttributeDataPtr;
112 OmniPvdAttributeDataType mCmdAttributeDataType;
113 uint32_t mCmdAttributeDataLen;
114 uint32_t mCmdAttributeNbrFields;
115 uint32_t mCmdEnumValue;
116 OmniPvdClassHandle mCmdEnumClassHandle;
117 OmniPvdClassHandle mCmdAttributeClassHandle;
118
119 OmniPvdAttributeHandle mCmdAttributeHandleStack[32];
120 uint8_t mCmdAttributeHandleDepth;
121
122 uint64_t mCmdFrameTimeStart;
123 uint64_t mCmdFrameTimeStop;
124
125 uint8_t *mDataBuffer;
126 uint32_t mDataBuffAllocatedLen;
127
128 bool mIsReadingStarted;
129 uint8_t mReadBaseClassHandle;
130};
131
132#endif
Definition OmniPvdLog.h:34
Used to abstract a memory read stream.
Definition OmniPvdReadStream.h:40
Definition OmniPvdReaderImpl.h:35
OmniPvdClassHandle OMNI_PVD_CALL getAttributeClassHandle()
Returns the numberclass handle of the attribute class.
Definition OmniPvdReaderImpl.cpp:377
uint8_t *OMNI_PVD_CALL getAttributeDataPointer()
Returns the attribute data pointer, the data is undefined if the last command did not contain attribu...
Definition OmniPvdReaderImpl.cpp:361
OmniPvdCommandEnum::Enum OMNI_PVD_CALL getCommandType()
Returns the command type as an enumerator of the latest command.
Definition OmniPvdReaderImpl.cpp:306
OmniPvdCommandEnum::Enum OMNI_PVD_CALL getNextCommand()
The heartbeat function of the reader class. As long as the command that is returned is not equal to O...
Definition OmniPvdReaderImpl.cpp:123
uint32_t OMNI_PVD_CALL getAttributeNumberElements()
Returns the number of elements contained in the last set operation.
Definition OmniPvdReaderImpl.cpp:373
bool OMNI_PVD_CALL startReading(OmniPvdVersionType *majorVersion, OmniPvdVersionType *minorVersion, OmniPvdVersionType *patch)
Extracts the versions from the binary file ro read and tests if the file is older or equal to that of...
Definition OmniPvdReaderImpl.cpp:65
OmniPvdVersionType OMNI_PVD_CALL getMajorVersion()
Returns the major version of the stream.
Definition OmniPvdReaderImpl.cpp:311
OmniPvdClassHandle OMNI_PVD_CALL getClassHandle()
Returns the class handle of the latest commmnd, if it had one, else 0.
Definition OmniPvdReaderImpl.cpp:331
void OMNI_PVD_CALL setLogFunction(OmniPvdLogFunction logFunction)
Sets the log function to print the internal debug messages of the OmniPVD Reader instance.
Definition OmniPvdReaderImpl.cpp:54
OmniPvdAttributeHandle OMNI_PVD_CALL getAttributeHandle()
Returns the attribute handle of the latest commmnd, if it had one, else 0.
Definition OmniPvdReaderImpl.cpp:341
OmniPvdContextHandle OMNI_PVD_CALL getContextHandle()
Returns the context handle of the latest commmnd, if it had one, else 0.
Definition OmniPvdReaderImpl.cpp:326
uint32_t OMNI_PVD_CALL getEnumValue()
Returns the enum value for a specific flag.
Definition OmniPvdReaderImpl.cpp:402
uint64_t OMNI_PVD_CALL getFrameTimeStop()
Returns the frame stop value.
Definition OmniPvdReaderImpl.cpp:393
char *OMNI_PVD_CALL getAttributeName()
Returns the attribute name of the latest commmnd, if it had one, else a null terminated string of len...
Definition OmniPvdReaderImpl.cpp:353
uint32_t OMNI_PVD_CALL getAttributeDataLength()
Returns the attribute data length, the data length of the last command.
Definition OmniPvdReaderImpl.cpp:369
OmniPvdVersionType OMNI_PVD_CALL getPatch()
Returns the patch number of the stream.
Definition OmniPvdReaderImpl.cpp:321
char *OMNI_PVD_CALL getClassName()
Returns the class name of the latest commmnd, if it had one, else a null terminated string of length ...
Definition OmniPvdReaderImpl.cpp:349
OmniPvdClassHandle OMNI_PVD_CALL getBaseClassHandle()
Returns the base class handle of the latest commmnd, if it had one, else 0.
Definition OmniPvdReaderImpl.cpp:336
OmniPvdVersionType OMNI_PVD_CALL getMinorVersion()
Returns the minor version of the stream.
Definition OmniPvdReaderImpl.cpp:316
OmniPvdClassHandle OMNI_PVD_CALL getEnumClassHandle()
Returns the class handle containing the enum values.
Definition OmniPvdReaderImpl.cpp:397
OmniPvdAttributeDataType OMNI_PVD_CALL getAttributeDataType()
Returns the attribute data type, the data is undefined if the last command did not contain attribute ...
Definition OmniPvdReaderImpl.cpp:365
char *OMNI_PVD_CALL getObjectName()
Returns the object name of the latest commmnd, if it had one, else a null terminated string of length...
Definition OmniPvdReaderImpl.cpp:357
void OMNI_PVD_CALL setReadStream(OmniPvdReadStream *stream)
Sets the read stream that contains the OmniPVD API command stream.
Definition OmniPvdReaderImpl.cpp:59
OmniPvdObjectHandle OMNI_PVD_CALL getObjectHandle()
Returns the object handle of the latest commmnd, if it had one, else 0.
Definition OmniPvdReaderImpl.cpp:345
uint64_t OMNI_PVD_CALL getFrameTimeStart()
Returns the frame start value.
Definition OmniPvdReaderImpl.cpp:389
Used to read debug information from an OmniPvdReadStream.
Definition OmniPvdReader.h:45