gwnavgeneration/generator/generatorinputoutput.h Source File

generatorinputoutput.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 
24 
25 namespace Kaim
26 {
27 
35 class GeneratorInputOutput : public RefCountBaseNTS<GeneratorInputOutput, MemStat_NavDataGen>
36 {
38 
39 public:
41  void ShallowCopy(const GeneratorInputOutput& other);
42  void DeepCopy(const GeneratorInputOutput& other, GeneratorSector::ClearPointedDataMode clearPointedDataMode);
43  void Clear();
44 
45  // ---------------------------------- Save, Load, Copy, Clear Functions ----------------------------------
46 
50  KyResult Save(const char* fullFileName, FileOpenerBase* fileOpener = nullptr) const;
51 
56  KyResult Load(const char* fullFileName, FileOpenerBase* fileOpener = nullptr);
57 
58  // ---------------------------------- Add/Remove/Set Functions ----------------------------------
59 
62 
65 
68  KyResult AddSector(Ptr<GeneratorSector> sector);
69 
81  void AddExclusiveGuids(const KyGuid* guids, KyUInt32 guidsCount);
82  void AddExclusiveGuids(const GeneratorGuidCompound& generatorGuidCompound);
83 
84  // ---------------------------------- Accessors ----------------------------------
85  KyUInt32 GetSectorCount() const;
86 
87  Ptr<GeneratorSector> GetSectorWithIndex(KyUInt32 index);
88  Ptr<GeneratorSector> GetSectorWithName(const char* name);
89  Ptr<GeneratorSector> GetSectorWithGuid(const KyGuid& guid);
90 
91  const Ptr<GeneratorSector> GetSectorWithIndex(KyUInt32 index) const;
92  const Ptr<GeneratorSector> GetSectorWithName(const char* name) const;
93  const Ptr<GeneratorSector> GetSectorWithGuid(const KyGuid& guid) const;
94 
95 private:
96  void CommonCopy(const GeneratorInputOutput& other);
97 
98 public:
99  GeneratorParameters m_params; //In
100  GeneratorAbstractGraphParameters m_abstractGraphParams; //In
101  GeneratorRunOptions m_runOptions; //In
102  KyArray<GeneratorGuidCompound> m_exclusiveGuids; //In
103  GeneratorSectorList m_sectors; // In/Out
104 
105  // Out. The info contained in m_navDataIndexHandler is redundant with m_sectors
106  // but having a NavDataIndex Blob available allows to load them in a pure runtime environment
107  // that does NOT link with gwnavgeneration.lib
108  Ptr< BlobHandler<NavDataIndex> > m_navDataIndexHandler;
109 
110  // Out. The info contained in m_abstractDataIndexHandler is redundant with m_sectors
111  // but having a AbstractDataIndex Blob available allows to load them in a pure runtime environment
112  // that does NOT link with gwnavgeneration.lib
113  Ptr< BlobHandler<AbstractDataIndex> > m_abstractDataIndexHandler;
114 
115  // Out. The info contained in m_colDataIndexHandler is redundant with m_sectors
116  // but having a ColDataIndex Blob in GenIO files allows to load them in a pure runtime environment
117  // that does not link with gwnavgeneration.lib
118  Ptr< BlobHandler<ColDataIndex> > m_colDataIndexHandler;
119 
120  // In/Out. contains only an indicative databaseIndex
121  DatabaseDescriptor m_databaseDescriptor;
122 };
123 
124 
125 }
126 
127 
Base interface for a class that opens a file on disk.
Definition: fileopener.h:30
KyResult AddSector(Ptr< GeneratorSector > sector)
Use this function to Add new GeneratorSector to the list stored in the GeneratorInputOutput.
Definition: generatorinputoutput.cpp:210
std::uint32_t KyUInt32
uint32_t
Definition: types.h:29
Ptr< GeneratorSector > GetSectorWithName(const char *name)
Returns the Sector with name if it exists, non const version.
Definition: generatorinputoutput.cpp:230
Ptr< GeneratorSector > GetSectorWithIndex(KyUInt32 index)
Returns the Sector at index if it exists, non const version.
Definition: generatorinputoutput.cpp:224
General purpose array for movable objects that require explicit construction/destruction.
Definition: kyarray.h:162
SectorInputSource
Describes where the Generator will get its input for each sector.
Definition: genflags.h:15
#define KY_CLASS_WITHOUT_COPY(ClassName)
Define to forbid copy constructor and copy assignment.
Definition: types.h:196
void SetSectorChangeForAllSectors(GenFlags::SectorChange sectorChange)
Set sectorChange for all sectors (regular and patches)
Definition: generatorinputoutput.cpp:63
KyUInt32 GetSectorCount() const
Returns the sector count.
Definition: generatorinputoutput.cpp:219
void SetInputSourceForAllSectors(GenFlags::SectorInputSource inputSource)
Set inputSource for all sectors (regular and patches)
Definition: generatorinputoutput.cpp:69
Ptr< GeneratorSector > GetSectorWithGuid(const KyGuid &guid)
Returns the Sector with guid if it exists, non const version.
Definition: generatorinputoutput.cpp:235
GeneratorInputOutput()
constructor
Definition: generatorinputoutput.cpp:20
void AddExclusiveGuids(const KyGuid *guids, KyUInt32 guidsCount)
Specifies the GUIDs of sectors that cover the same areas of terrain, but that will never be loaded in...
Definition: generatorinputoutput.cpp:255
Easy to write/read version of DatabaseDescriptorBlob.
Definition: databasedescriptor.h:34
Navigation return code class.
Definition: types.h:108
SectorChange
Describes what the generation does about a sector.
Definition: genflags.h:26
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17
The KyGuid class represents a globally unique ID.
Definition: kyguid.h:20
KyResult Load(const char *fullFileName, FileOpenerBase *fileOpener=nullptr)
Load the GeneratorInputOutput from a file.
Definition: generatorinputoutput.cpp:143
The GeneratorInputOutput class is a central element of the generation.
Definition: generatorinputoutput.h:35
The GeneratorParameters class contains configuration parameters that control the characteristics of t...
Definition: generatorparameters.h:67
KyResult Save(const char *fullFileName, FileOpenerBase *fileOpener=nullptr) const
Save the GeneratorInputOutput in a file.
Definition: generatorinputoutput.cpp:75
The GeneratorRunOptions class contains configuration parameters that control the way in which the Gen...
Definition: generatorrunoptions.h:43
This class is a wrapper around an array of KyGuid objects.
Definition: generatorguidcompound.h:20
ClearPointedDataMode
Reset the GeneratorSector as if is was just default constructed.
Definition: generatorsector.h:56
void Clear()
Reset members as if the object was freshly constructed.
Definition: generatorinputoutput.cpp:23