COGS
Computer Graphics Structures library
cogs::io::DataBlockManager Class Reference

Container class for specific data block factory objects. More...

Public Member Functions

 DataBlockManager ()
 Creates manager with predefined data block factories.
 
 DataBlockManager (const DataBlockManager &)=delete
 
DataBlockManager & operator= (const DataBlockManager &)=delete
 
 DataBlockManager (DataBlockManager &&)=delete
 
DataBlockManager & operator= (DataBlockManager &&) &=delete
 
bool HasFactoryFor (const DataBlockType &datablock_type)
 Checks if current instance has a factory for defined datablock_type already.
 
std::unique_ptr< DataBlock > Create (const DataBlockType &datablock_type, DataBlockIndex index)
 Creates new instance of data block using corresponding factory.
 
template<typename T >
void AddFactoryFor (const DataBlockType &datablock_type)
 Registers new factory type T for the defined datablock_type. More...
 

Static Public Attributes

static const DataBlockType POINTCLOUD_DTB_TYPE
 Identifier of predefined point cloud data block class.
 
static const DataBlockType SCAN_DTB_TYPE
 Identifier of predefined scan data block class.
 
static const DataBlockType MESH_DTB_TYPE
 Identifier of predefined mesh data block class.
 
static const DataBlockType TRIANGULATION_DTB_TYPE
 Identifier of predefined triangulation data block class.
 

Detailed Description

Container class for specific data block factory objects.

Used for registering new data block factories and creation of data blocks.

By default class contains predefined factories for data blocks, but can be extended to support custom, user defined ones.

Member Function Documentation

◆ AddFactoryFor()

template<typename T >
void cogs::io::DataBlockManager::AddFactoryFor ( const DataBlockType &  datablock_type)

Registers new factory type T for the defined datablock_type.

Note
When the factory of specified type does not exist, method logs message and does nothing.