gwnavruntime/querysystem/queryqueuearray.h Source File

queryqueuearray.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 #pragma once
8 
11 
12 namespace Kaim
13 {
14 
15 class QueryQueue;
16 class World;
17 
18 
19 enum QueryQueueArrayProcess
20 {
21  QueryQueueArrayProcess_InWorldUpdate,
22  QueryQueueArrayProcess_OutOfWorldUpdate,
23 };
24 
25 
32 {
33  KY_DEFINE_NEW_DELETE_OPERATORS(MemStat_QuerySystem)
35 
36 public:
37  static WorldElementType GetStaticType() { return TypeQueryQueueArray; }
38  virtual WorldElementType GetType() const { return TypeQueryQueueArray; }
39  virtual const char* GetTypeName() const { return "QueryQueueArray"; }
40 
42  virtual ~QueryQueueArray() {}
43 
44  void Init(World* world, KyUInt32 queueCount, QueryQueueArrayProcess queryQueueArrayProcessThread);
45 
46  void AddToWorld();
47  void RemoveFromWorld();
48 
49  void ProcessQueues();
50 
51  void FlushQueries();
52 
53  void FlushCommands();
54 
55  KyUInt32 GetQueueCount() { return m_queues.GetCount(); }
56  QueryQueue* GetQueue(KyUInt32 index) { return m_queues[index]; }
57 
58  KyUInt32 GetPendingOperationCount();
59 
60  bool IsProcessedInWorldUpdate() const { return m_queryQueueArrayProcessThread == QueryQueueArrayProcess_InWorldUpdate; }
61 
62  virtual void DoSendVisualDebug(VisualDebugServer& server, VisualDebugSendChangeEvent changeEvent); // Inherited from WorldElement
63 
64  void CancelAllQueriesAndClearCommands();
65 
66  void ForceClearWorkingMemory();
67 private:
68  KyArray<Ptr<QueryQueue>, MemStat_QuerySystem> m_queues;
69  QueryQueueArrayProcess m_queryQueueArrayProcessThread;
70 };
71 
72 } // namespace Kaim
73 
74 
75 
std::uint32_t KyUInt32
uint32_t
Definition: types.h:29
QueryQueueArray processes queries in an asynchronous, time-sliced way.
Definition: queryqueuearray.h:31
QueryQueue processes queries in an asynchronous, time-sliced way, within a QueryQueueArray.
Definition: queryqueue.h:73
General purpose array for movable objects that require explicit construction/destruction.
Definition: kyarray.h:162
#define KY_CLASS_WITHOUT_COPY(ClassName)
Define to forbid copy constructor and copy assignment.
Definition: types.h:196
This class is a runtime container for Autodesk Navigation WorldElements such as NavData, Bots, BoxObstacles, TagVolumes...
Definition: world.h:52
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:132
WorldElementType
Enumerates the WorldElement types.
Definition: worldelementtype.h:13
Base internal class used to represent elements that can be added to a World, such as instances of Dat...
Definition: worldelement.h:41
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17