gwnavruntime/navdata/navdataindex.h Source File
Go to the documentation of this file.
9 #ifndef Navigation_NavDataIndex_H
10 #define Navigation_NavDataIndex_H
23 class NavDataDescriptor
28 NavDataDescriptor() {}
29 const char* GetFileName()
const {
return m_fileName.GetValues(); }
31 BlobArray<char> m_fileName;
37 SwapEndianness(e,
self.m_fileName);
38 SwapEndianness(e,
self.m_guid);
39 SwapEndianness(e,
self.m_boundingBox);
46 KY_ROOT_BLOB_CLASS(NavData, NavDataIndex, 0)
50 KyUInt32 GetDescriptorsCount()
const {
return m_descriptors.GetCount(); }
51 const NavDataDescriptor& GetDescriptor(
KyUInt32 index)
const {
return m_descriptors.GetValues()[index]; }
52 BlobArray<NavDataDescriptor> m_descriptors;
57 SwapEndianness(e,
self.m_descriptors);
60 class NavDataIndexLoader
65 static Ptr< BlobHandler<NavDataIndex> > LoadNavDataIndex(const
char* filename, FileOpenerBase* fileOpener =
KY_NULL)
67 DefaultFileOpener defaultFileOpener;
68 FileOpenerBase* opener = fileOpener ? fileOpener : &defaultFileOpener;
72 KY_LOG_ERROR((
"Could not open file [%s]", filename));
76 BlobAggregate blobAggregate;
78 if (blobAggregate.Load(file, MemStat_Blob, KY_NULL, BLOB_AGGREGATE_IGNORE_UNKNOWN_BLOBTYPES) ==
KY_ERROR)
81 BlobAggregate::Collection<NavDataIndex> collection = blobAggregate.GetCollection<NavDataIndex>();
83 if (collection.GetCount() == 0)
85 KY_LOG_ERROR((
"File [%s] does not contain any NavDataIndex", filename));
89 if (collection.GetCount() > 1)
91 KY_LOG_ERROR((
"ERROR: File [%s] does contains more than 1 NavDataIndex", filename));
95 return collection.GetHandler(0);
#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
Target
Enumerates the possible endianness types relative to the current platform.
Definition: endianness.h:35
Opens the file for reading only.
Definition: fileopener.h:30
Definition: gamekitcrowddispersion.h:20
#define KY_ERROR
Shorthand for Kaim::Result::Failure.
Definition: types.h:272
#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