gwnavruntime/abstractgraph/blobs/abstractdataindex.h Source File
Go to the documentation of this file.
21 class AbstractDataDescriptor
26 AbstractDataDescriptor() {}
27 const char* GetFileName()
const {
return m_fileName.GetValues(); }
29 BlobArray<char> m_fileName;
35 SwapEndianness(e,
self.m_fileName);
36 SwapEndianness(e,
self.m_guid);
37 SwapEndianness(e,
self.m_boundingBox);
41 class AbstractDataIndex
44 KY_ROOT_BLOB_CLASS(NavData, AbstractDataIndex, 0)
47 AbstractDataIndex() {}
48 KyUInt32 GetDescriptorsCount()
const {
return m_descriptors.GetCount(); }
49 const AbstractDataDescriptor& GetDescriptor(
KyUInt32 index)
const {
return m_descriptors.GetValues()[index]; }
50 BlobArray<AbstractDataDescriptor> m_descriptors;
55 SwapEndianness(e,
self.m_descriptors);
58 class AbstractDataIndexLoader
63 static Ptr< BlobHandler<AbstractDataIndex> > LoadAbstractDataIndex(const
char* filename, FileOpenerBase* fileOpener =
nullptr)
68 KY_LOG_ERROR((
"Could not open file [%s]", filename));
72 BlobAggregate blobAggregate;
73 if (blobAggregate.Load(file, MemStat_Blob,
nullptr, BLOB_AGGREGATE_IGNORE_UNKNOWN_BLOBTYPES) ==
KY_ERROR)
76 BlobAggregate::Collection<AbstractDataIndex> collection = blobAggregate.GetCollection<AbstractDataIndex>();
78 if (collection.GetCount() == 0)
80 KY_LOG_ERROR((
"File [%s] does not contain any AbstractDataIndex", filename));
84 if (collection.GetCount() > 1)
86 KY_LOG_ERROR((
"ERROR: File [%s] does contains more than 1 AbstractDataIndex", filename));
90 return collection.GetHandler(0);
std::uint32_t KyUInt32
uint32_t
Definition: types.h:29
virtual Ptr< File > OpenFile(const char *filename, FileOpenerMode mode)
Override to open a file using user-defined function and/or File class.
Definition: fileopener.h:62
#define KY_CLASS_WITHOUT_COPY(ClassName)
Define to forbid copy constructor and copy assignment.
Definition: types.h:196
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:132
Target
Enumerates the possible endianness types relative to the current platform.
Definition: endianness.h:27
Opens the file for reading only.
Definition: fileopener.h:25
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17
#define KY_ERROR
use result == KY_ERROR to test for error
Definition: types.h:132
Simple default implementation of an object that opens a file on disk that is called when the primaryF...
Definition: fileopener.h:55