gwnavruntime/world/databasebinding.h Source File

databasebinding.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 
13 
14 namespace Kaim
15 {
16 
17 class Database;
18 class World;
19 
21 class DatabaseBinding : public RefCountBaseNTS<DatabaseBinding, MemStat_WorldFwk>
22 {
23 public:
24  static const KyUInt32 InvalidBoundDatabaseIndex;
25 
26 
27  // ------------------------------ Functions -----------------------------
28 
29  DatabaseBinding() : m_world(nullptr) {}
30 
42  KyResult AddDataBase(Database* database);
43 
44  World* GetWorld() { return m_world; }
45 
46  KyUInt32 GetBoundDatabaseCount() const { return m_boundDatabases.GetCount(); }
47 
50  Database* GetBoundDatabase(KyUInt32 boundDatabaseIndex) const { return m_boundDatabases[boundDatabaseIndex]; }
51 
54  KyUInt32 GetBoundDatabaseIdx(KyUInt32 databaseIdxInWorld) const { return m_boundIndicesFromIdxInWorld[databaseIdxInWorld]; }
55 
56  void Clear();
57 
58 private:
59  void InitForWorld(World* world);
60 
61 private:
62  World* m_world;
63  KyArray<Database*, MemStat_WorldFwk> m_boundDatabases; // count <= m_world->GetDatabaseCount();
64  KyArray<KyUInt32, MemStat_WorldFwk> m_boundIndicesFromIdxInWorld; // count == m_world->GetDatabaseCount();
65 };
66 
67 }
68 
std::uint32_t KyUInt32
uint32_t
Definition: types.h:29
KyUInt32 GetBoundDatabaseIdx(KyUInt32 databaseIdxInWorld) const
Definition: databasebinding.h:54
Database * GetBoundDatabase(KyUInt32 boundDatabaseIndex) const
Definition: databasebinding.h:50
KyResult AddDataBase(Database *database)
Adds a Database to this DatabaseBinding instance.
Definition: databasebinding.cpp:25
General purpose array for movable objects that require explicit construction/destruction.
Definition: kyarray.h:162
This class is a runtime container for Autodesk Navigation WorldElements such as NavData, Bots, BoxObstacles, TagVolumes...
Definition: world.h:52
This class is a runtime container for all NavData that represents the world from the point of view of...
Definition: database.h:57
Navigation return code class.
Definition: types.h:108
DatabaseBinding is a collection of the databases to be used for world elements spatialization.
Definition: databasebinding.h:21
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17