gwnavruntime/blob/blobcategory.h Source File

blobcategory.h
Go to the documentation of this file.
1 /*
2 * Copyright 2015 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 // primary contact: GUAL - secondary contact: NOBODY
9 #ifndef Navigation_BlobCategory_H
10 #define Navigation_BlobCategory_H
11 
12 
17 
18 
19 namespace Kaim
20 {
21 
22 
26 {
27  KY_DEFINE_NEW_DELETE_OPERATORS(MemStat_BaseSystem)
28 
29 public:
30  BlobCategory(KyUInt32 nameSpaceEnum, KyUInt32 categoryEnum)
31  {
32  m_categoryId = BlobTypeIdUtils::BuildCategoryId(nameSpaceEnum, categoryEnum);
33  }
34 
35  template<class T> void AddBlobType()
36  {
37  Ptr<BlobTypeDescriptor<T> > blobTypeDescriptor = *KY_NEW_ID(MemStat_BaseSystem) BlobTypeDescriptor<T>;
38  KyUInt32 blobEnum = BlobTypeIdUtils::GetBlobEnum(blobTypeDescriptor->GetBlobTypeId());
39  m_descriptors[blobEnum] = blobTypeDescriptor;
40  }
41 
42  void Resize(KyUInt32 count) { return m_descriptors.Resize(count); }
43 
44  void Clear() { m_descriptors.Clear(); }
45 
46  KyUInt32 GetCount() { return m_descriptors.GetCount(); }
47 
48  IBlobTypeDescriptor* GetDescriptor(KyUInt32 blobTypeId) const { return m_descriptors[BlobTypeIdUtils::GetBlobEnum(blobTypeId)]; }
49 
50 public:
51  KyUInt32 m_categoryId;
52  KyArray<Ptr<IBlobTypeDescriptor>, MemStat_BaseSystem> m_descriptors;
53 };
54 
55 
56 }
57 
58 
59 #endif
60 
General purpose array for movable objects that require explicit construction/destruction.
Definition: kyarray.h:118
Definition: gamekitcrowddispersion.h:20
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:137
KyArray< Ptr< IBlobTypeDescriptor >, MemStat_BaseSystem > m_descriptors
The array of descriptors that make up this registry. Do not modify.
Definition: blobcategory.h:54
unsigned int KyUInt32
Type used internally to represent an unsigned 32-bit integer.
Definition: types.h:36
The BlobCategory class represents a collection of blob types.
Definition: blobcategory.h:25