gwnavruntime/world/databasebinding.h Source File

databasebinding.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: JAPA
9 
10 #ifndef Navigation_DatabaseBinding_H
11 #define Navigation_DatabaseBinding_H
12 
16 
17 namespace Kaim
18 {
19 
20 class Database;
21 class World;
22 
24 class DatabaseBinding : public RefCountBaseNTS<DatabaseBinding, MemStat_WorldFwk>
25 {
26 public:
27  static const KyUInt32 InvalidBoundDatabaseIndex;
28 
29 
30  // ---------------------------------- Public Member Functions ----------------------------------
31 
32  DatabaseBinding() : m_world(KY_NULL) {}
33 
45  KyResult AddDataBase(Database* database);
46 
47  World* GetWorld() { return m_world; }
48 
49  KyUInt32 GetBoundDatabaseCount() const { return m_boundDatabases.GetCount(); }
50 
53  Database* GetBoundDatabase(KyUInt32 boundDatabaseIndex) const { return m_boundDatabases[boundDatabaseIndex]; }
54 
57  KyUInt32 GetBoundDatabaseIdx(KyUInt32 databaseIdxInWorld) const { return m_boundIndicesFromIdxInWorld[databaseIdxInWorld]; }
58 
59  void Clear();
60 
61 private:
62  void InitForWorld(World* world);
63 
64 private:
65  World* m_world;
66  KyArray<Database*, MemStat_WorldFwk> m_boundDatabases; // count <= m_world->GetDatabaseCount();
67  KyArray<KyUInt32, MemStat_WorldFwk> m_boundIndicesFromIdxInWorld; // count == m_world->GetDatabaseCount();
68 };
69 
70 }
71 
72 #endif
KyInt32 KyResult
Defines a type that can be returned by methods or functions in the Gameware Navigation SDK to indicat...
Definition: types.h:254
KyUInt32 GetBoundDatabaseIdx(KyUInt32 databaseIdxInWorld) const
Definition: databasebinding.h:62
Database * GetBoundDatabase(KyUInt32 boundDatabaseIndex) const
Definition: databasebinding.h:58
KyResult AddDataBase(Database *database)
Adds a Database to this DatabaseBinding instance.
General purpose array for movable objects that require explicit construction/destruction.
Definition: kyarray.h:118
#define KY_NULL
Null value.
Definition: types.h:247
This class is a runtime container for Gameware Navigation WorldElements such as NavData, Bots, BoxObstacles, TagVolumes...
Definition: world.h:54
This class is a runtime container for all NavData that represents the world from the point of view of...
Definition: database.h:64
DatabaseBinding is a collection of the databases to be used for world elements spatialization.
Definition: databasebinding.h:24
Definition: gamekitcrowddispersion.h:20
unsigned int KyUInt32
Type used internally to represent an unsigned 32-bit integer.
Definition: types.h:36