gwnavruntime/abstractgraph/blobs/abstractdataindex.h Source File
Go to the documentation of this file.
8 #ifndef Navigation_AbstractDataIndex_H
9 #define Navigation_AbstractDataIndex_H
22 class AbstractDataDescriptor
27 AbstractDataDescriptor() {}
28 const char* GetFileName()
const {
return m_fileName.GetValues(); }
30 BlobArray<char> m_fileName;
36 SwapEndianness(e,
self.m_fileName);
37 SwapEndianness(e,
self.m_guid);
38 SwapEndianness(e,
self.m_boundingBox);
42 class AbstractDataIndex
45 KY_ROOT_BLOB_CLASS(NavData, AbstractDataIndex, 0)
48 AbstractDataIndex() {}
49 KyUInt32 GetDescriptorsCount()
const {
return m_descriptors.GetCount(); }
50 const AbstractDataDescriptor& GetDescriptor(
KyUInt32 index)
const {
return m_descriptors.GetValues()[index]; }
51 BlobArray<AbstractDataDescriptor> m_descriptors;
56 SwapEndianness(e,
self.m_descriptors);
59 class AbstractDataIndexLoader
64 static Ptr< BlobHandler<AbstractDataIndex> > LoadAbstractDataIndex(const
char* filename, FileOpenerBase* fileOpener =
KY_NULL)
66 DefaultFileOpener defaultFileOpener;
67 FileOpenerBase* opener = fileOpener ? fileOpener : &defaultFileOpener;
71 KY_LOG_ERROR((
"Could not open file [%s]", filename));
75 BlobAggregate blobAggregate;
76 if (blobAggregate.Load(file, MemStat_Blob, KY_NULL, BLOB_AGGREGATE_IGNORE_UNKNOWN_BLOBTYPES) ==
KY_ERROR)
79 BlobAggregate::Collection<AbstractDataIndex> collection = blobAggregate.GetCollection<AbstractDataIndex>();
81 if (collection.GetCount() == 0)
83 KY_LOG_ERROR((
"File [%s] does not contain any AbstractDataIndex", filename));
87 if (collection.GetCount() > 1)
89 KY_LOG_ERROR((
"ERROR: File [%s] does contains more than 1 AbstractDataIndex", filename));
93 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