gwnavgeneration/generator/generatorsectorlist.h Source File

generatorsectorlist.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 // primary contact: GUAL - secondary contact: LASI
8 #ifndef GwNavGen_GeneratorSectorList_H
9 #define GwNavGen_GeneratorSectorList_H
10 
11 
13 
14 
15 namespace Kaim
16 {
17 
18 class GeneratorSectorList
19 {
20  KY_DEFINE_NEW_DELETE_OPERATORS(Stat_Default_Mem)
21  KY_CLASS_WITHOUT_COPY(GeneratorSectorList)
22 
23 public:
24  GeneratorSectorList();
25  void ShallowCopy(const GeneratorSectorList& other); // copy and original point to the same GeneratorSectors
26 
28  // You can either Clear
29  void DeepCopy(const GeneratorSectorList& other, GeneratorSector::ClearPointedDataMode clearPointedDataMode);
30 
31  void Clear();
32 
33  // returns KY_ERROR if a sector with same name or Guid is already in the list
34  KyResult AddSector(Ptr<GeneratorSector> sector);
35 
36  // returns KY_ERROR if sector can't be found
37  KyResult RemoveSectorWithName(char* name);
38  KyResult RemoveSectorWithGuid(const KyGuid& guid);
39  KyResult RemoveSectorAtIdx(KyUInt32 idx);
40  void RemoveAllSectors();
41 
42  // returns KyUInt32MaxVal if not found
43  KyUInt32 GetSectorIdxFromName(const char* name);
44  KyUInt32 GetSectorIdxFromGuid(const KyGuid& guid);
45 
46  // returns KY_NULL if not found
47  Ptr<GeneratorSector> GetSectorWithName(const char* name);
48  Ptr<GeneratorSector> GetSectorWithGuid(const KyGuid& guid);
49  Ptr<GeneratorSector> GetSector(KyUInt32 index) { return index < m_sectors.GetCount() ? m_sectors[index] : KY_NULL; }
50 
51  const Ptr<GeneratorSector> GetSectorWithName(const char* name) const;
52  const Ptr<GeneratorSector> GetSectorWithGuid(const KyGuid& guid) const ;
53  const Ptr<GeneratorSector> GetSector(KyUInt32 index) const { return index < m_sectors.GetCount() ? m_sectors[index] : KY_NULL; }
54 
55  const KyArray< Ptr<GeneratorSector> >& GetSectors() const { return m_sectors; }
56  KyArray< Ptr<GeneratorSector> >& GetSectors() { return m_sectors; }
57  KyUInt32 GetSectorCount() const { return m_sectors.GetCount(); }
58 
59 public:
60  KyArray<Ptr<GeneratorSector> > m_sectors;
61 };
62 
63 
64 }
65 
66 
67 #endif
68 
KyInt32 KyResult
Defines a type that can be returned by methods or functions in the Gameware Navigation SDK to indicat...
Definition: types.h:254
#define KY_NULL
Null value.
Definition: types.h:247
#define KY_CLASS_WITHOUT_COPY(ClassName)
Define to forbid copy constructor and copy assignment.
Definition: types.h:387
Definition: gamekitcrowddispersion.h:20
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:137
unsigned int KyUInt32
Type used internally to represent an unsigned 32-bit integer.
Definition: types.h:36