NvBlastTkTypeImpl.h
Go to the documentation of this file.
1 // This code contains NVIDIA Confidential Information and is disclosed to you
2 // under a form of NVIDIA software license agreement provided separately to you.
3 //
4 // Notice
5 // NVIDIA Corporation and its licensors retain all intellectual property and
6 // proprietary rights in and to this software and related documentation and
7 // any modifications thereto. Any use, reproduction, disclosure, or
8 // distribution of this software and related documentation without an express
9 // license agreement from NVIDIA Corporation is strictly prohibited.
10 //
11 // ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
12 // NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
13 // THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
14 // MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
15 //
16 // Information and code furnished is believed to be accurate and reliable.
17 // However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
18 // information or for any infringement of patents or other rights of third parties that may
19 // result from its use. No license is granted by implication or otherwise under any patent
20 // or patent rights of NVIDIA Corporation. Details are subject to change without notice.
21 // This code supersedes and replaces all information previously supplied.
22 // NVIDIA Corporation products are not authorized for use as critical
23 // components in life support devices or systems without express written approval of
24 // NVIDIA Corporation.
25 //
26 // Copyright (c) 2016-2020 NVIDIA Corporation. All rights reserved.
27 
28 
29 #ifndef NVBLASTTKTYPEIMPL_H
30 #define NVBLASTTKTYPEIMPL_H
31 
32 
33 #include "NvPreprocessor.h"
34 
35 #include "NvBlastTkType.h"
36 
37 
38 namespace Nv
39 {
40 namespace Blast
41 {
42 
46 class TkTypeImpl : public TkType
47 {
48 public:
49  TkTypeImpl(const char* typeName, uint32_t typeID, uint32_t version);
50 
51  // Begin TkType
52  virtual const char* getName() const override { return getNameInternal(); }
53 
54  virtual uint32_t getVersion() const override { return getVersionInternal(); }
55  // End TkType
56 
57  // Public methods
58 
64  const char* getNameInternal() const;
65 
71  uint32_t getVersionInternal() const;
72 
78  uint32_t getID() const;
79 
85  uint32_t getIndex() const;
86 
90  bool indexIsValid() const;
91 
92 private:
93  enum { InvalidIndex = 0xFFFFFFFF };
94 
100  void setIndex(uint32_t index);
101 
102  const char* m_name;
103  uint32_t m_ID;
104  uint32_t m_version;
105  uint32_t m_index;
106 
107  friend class TkFrameworkImpl;
108 };
109 
110 
112 
113 NV_INLINE TkTypeImpl::TkTypeImpl(const char* typeName, uint32_t typeID, uint32_t version)
114  : m_name(typeName)
115  , m_ID(typeID)
116  , m_version(version)
117  , m_index((uint32_t)InvalidIndex)
118 {
119 }
120 
121 
123 {
124  return m_name;
125 }
126 
127 
129 {
130  return m_version;
131 }
132 
133 
134 NV_INLINE uint32_t TkTypeImpl::getID() const
135 {
136  return m_ID;
137 }
138 
139 
141 {
142  return m_index;
143 }
144 
145 
147 {
148  return m_index != (uint32_t)InvalidIndex;
149 }
150 
151 
152 NV_INLINE void TkTypeImpl::setIndex(uint32_t index)
153 {
154  m_index = index;
155 }
156 
157 } // namespace Blast
158 } // namespace Nv
159 
160 
161 #endif // ifndef NVBLASTTKTYPEIMPL_H
bool indexIsValid() const
Definition: NvBlastTkTypeImpl.h:146
uint32_t getID() const
Definition: NvBlastTkTypeImpl.h:134
Definition: NvBlastTkTypeImpl.h:46
uint32_t getVersionInternal() const
Definition: NvBlastTkTypeImpl.h:128
TkTypeImpl(const char *typeName, uint32_t typeID, uint32_t version)
Definition: NvBlastTkTypeImpl.h:113
virtual uint32_t getVersion() const override
Definition: NvBlastTkTypeImpl.h:54
const char * getNameInternal() const
Definition: NvBlastTkTypeImpl.h:122
Definition: NvBlastTkType.h:46
#define NV_INLINE
Definition: NvPreprocessor.h:350
virtual const char * getName() const override
Definition: NvBlastTkTypeImpl.h:52
Definition: NvBlastTkFrameworkImpl.h:54
uint32_t getIndex() const
Definition: NvBlastTkTypeImpl.h:140
Definition: NvBlastArray.h:37