gwnavruntime/blob/blobcategory.h Source File

blobcategory.h
Go to the documentation of this file.
1 /*
2 * Copyright 2016 Autodesk, Inc. All rights reserved.
3 * Use of this software is subject to the terms of the Autodesk license agreement and any attachments or Appendices thereto provided at the time of installation or download,
4 * or which otherwise accompanies this software in either electronic or hard copy form, or which is signed by you and accepted by Autodesk.
5 */
6 
7 
8 #pragma once
9 
10 
15 
16 
17 namespace Kaim
18 {
19 
20 
24 {
25  KY_DEFINE_NEW_DELETE_OPERATORS(MemStat_BaseSystem)
26 
27 public:
28  BlobCategory(KyUInt32 nameSpaceEnum, KyUInt32 categoryEnum)
29  {
30  m_categoryId = BlobTypeIdUtils::BuildCategoryId(nameSpaceEnum, categoryEnum);
31  }
32 
33  template<class T> void AddBlobType()
34  {
35  Ptr<BlobTypeDescriptor<T> > blobTypeDescriptor = *KY_NEW_ID(MemStat_BaseSystem) BlobTypeDescriptor<T>;
36  KyUInt32 blobEnum = BlobTypeIdUtils::GetBlobEnum(blobTypeDescriptor->GetBlobTypeId());
37  m_descriptors[blobEnum] = blobTypeDescriptor;
38  }
39 
40  void Resize(KyUInt32 count) { return m_descriptors.Resize(count); }
41 
42  void Clear() { m_descriptors.Clear(); }
43 
44  KyUInt32 GetCount() { return m_descriptors.GetCount(); }
45 
46  IBlobTypeDescriptor* GetDescriptor(KyUInt32 blobTypeId) const { return m_descriptors[BlobTypeIdUtils::GetBlobEnum(blobTypeId)]; }
47 
48 public:
49  KyUInt32 m_categoryId;
51 };
52 
53 
54 }
55 
56 
57 
std::uint32_t KyUInt32
uint32_t
Definition: types.h:29
General purpose array for movable objects that require explicit construction/destruction.
Definition: kyarray.h:162
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:132
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17
KyArray< Ptr< IBlobTypeDescriptor >, MemStat_BaseSystem > m_descriptors
The array of descriptors that make up this registry. Do not modify.
Definition: blobcategory.h:50
The BlobCategory class represents a collection of blob types.
Definition: blobcategory.h:23