1 #ifndef COGS_DATA_BLOCK_MANAGER_H 2 #define COGS_DATA_BLOCK_MANAGER_H 4 #include <unordered_map> 6 #include <Utils/Ulog.h> 8 #include <COGS/io/DataBlock.h> 45 [[nodiscard]]
bool HasFactoryFor(
const DataBlockType &datablock_type);
60 std::unordered_map<DataBlockType, std::unique_ptr<DataBlockFactory>> factories_;
66 if (HasFactoryFor(datablock_type))
68 ulog::Fail(
"Cannot create DataBlockFactory for type '" 69 + datablock_type +
"'. Another factory for that type already exists.",
"cogs::io::DataBlockManager::AddFactoryFor");
73 factories_[datablock_type] = std::make_unique<T>();
Namespace of "Computer Graphic Structures" library, which implement many core classes and structures...
Definition: AabbHierarchy.h:8
static const DataBlockType MESH_DTB_TYPE
Identifier of predefined mesh data block class.
Definition: DataBlockManager.h:32
size_t DataBlockIndex
Defines position index of the data block in a file.
Definition: DataBlock.h:13
static const DataBlockType POINTCLOUD_DTB_TYPE
Identifier of predefined point cloud data block class.
Definition: DataBlockManager.h:28
Container class for specific data block factory objects.
Definition: DataBlockManager.h:24
static const DataBlockType SCAN_DTB_TYPE
Identifier of predefined scan data block class.
Definition: DataBlockManager.h:30
static const DataBlockType TRIANGULATION_DTB_TYPE
Identifier of predefined triangulation data block class.
Definition: DataBlockManager.h:34
void AddFactoryFor(const DataBlockType &datablock_type)
Registers new factory type T for the defined datablock_type.
Definition: DataBlockManager.h:64
std::string DataBlockType
Identifies data block instances. Each class derived from cogs::io::DataBlockType should have unique t...
Definition: DataBlock.h:22