gwnavruntime/querysystem/queryqueueblob.h Source File

queryqueueblob.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: MAMU - secondary contact: NOBODY
9 #ifndef Navigation_QueryQueueBlob_H
10 #define Navigation_QueryQueueBlob_H
11 
14 
15 namespace Kaim
16 {
17 
18 class QueryQueue;
19 
20 class QueryQueueBlob
21 {
22  KY_ROOT_BLOB_CLASS(Runtime, QueryQueueBlob, 0)
23 public:
24  QueryQueueBlob()
25  : m_queueIndex(0)
26  , m_elementId(0)
27  , m_budgetInMilliseconds(0.0f)
28  , m_workingMemoryMaxSizeInBytes(0)
29  {}
30 
31  KyUInt32 m_queueIndex;
32  KyUInt32 m_elementId;
33  KyUInt32 m_queueArrayProcess;
34  KyFloat32 m_budgetInMilliseconds;
35  KyUInt32 m_workingMemoryMaxSizeInBytes;
36  BlobArray<char> m_queueName;
37 
38  // Stats
39  KyUInt32 m_queriesPopped;
40  KyUInt32 m_queriesInQueue;
41  KyFloat32 m_timeSpent;
42  KyFloat32 m_maxTimeSpent;
43  KyFloat32 m_averageTimeSpent;
44  KyUInt32 m_allocatedWorkingMemoryInBytes;
45 };
46 
47 inline void SwapEndianness(Endianness::Target e, QueryQueueBlob& self)
48 {
49  SwapEndianness(e, self.m_queueIndex);
50  SwapEndianness(e, self.m_elementId);
51  SwapEndianness(e, self.m_queueArrayProcess);
52  SwapEndianness(e, self.m_budgetInMilliseconds);
53  SwapEndianness(e, self.m_workingMemoryMaxSizeInBytes);
54  SwapEndianness(e, self.m_queueName);
55 
56  SwapEndianness(e, self.m_queriesPopped);
57  SwapEndianness(e, self.m_queriesInQueue);
58  SwapEndianness(e, self.m_timeSpent);
59  SwapEndianness(e, self.m_maxTimeSpent);
60  SwapEndianness(e, self.m_averageTimeSpent);
61  SwapEndianness(e, self.m_allocatedWorkingMemoryInBytes);
62 }
63 
64 class QueryQueueBlobBuilder : public BaseBlobBuilder< QueryQueueBlob >
65 {
66  KY_CLASS_WITHOUT_COPY(QueryQueueBlobBuilder)
67 public:
68  QueryQueueBlobBuilder(const QueryQueue* queryQueue, KyUInt32 queryQueueArrayIndex, KyUInt32 queryQueueIndex, KyUInt32 queueArrayProcess)
69  : m_queryQueue(queryQueue), m_queryQueueArrayIndex(queryQueueArrayIndex), m_queryQueueIndex(queryQueueIndex), m_queueArrayProcess(queueArrayProcess) {}
70 
71 private:
72  virtual void DoBuild();
73 
74  const QueryQueue* m_queryQueue;
75  KyUInt32 m_queryQueueArrayIndex;
76  KyUInt32 m_queryQueueIndex;
77  KyUInt32 m_queueArrayProcess;
78 };
79 
80 } // namespace Kaim
81 
82 #endif // Navigation_QueryQueueBlob_H
#define KY_CLASS_WITHOUT_COPY(ClassName)
Define to forbid copy constructor and copy assignment.
Definition: types.h:387
Target
Enumerates the possible endianness types relative to the current platform.
Definition: endianness.h:35
Definition: gamekitcrowddispersion.h:20
unsigned int KyUInt32
Type used internally to represent an unsigned 32-bit integer.
Definition: types.h:36
float KyFloat32
Type used internally to represent a 32-bit floating-point number.
Definition: types.h:43