Lightmetrica  0.0.1.50dbee3 (yosakoi)
 All Classes Functions Variables Typedefs Enumerations Enumerator
Public Member Functions | List of all members
AssetsImpl Class Referencefinal

Public Member Functions

 LM_COMPONENT_IMPL_DEF ("default")
 
virtual bool Load (const ConfigNode &node) override
 
virtual AssetGetAssetByName (const std::string &name) const override
 
virtual boost::signals2::connection Connect_ReportProgress (const std::function< void(double, bool)> &func) override
 
virtual bool RegisterInterface (const std::string &interfaceName, const std::string &interfaceGroupName, const std::vector< std::string > &dependencies) override
 
- Public Member Functions inherited from Assets
 LM_COMPONENT_INTERFACE_DEF ("assets")
 
template<typename AssetInterfaceType >
bool RegisterInterface ()
 
LM_PUBLIC_API AssetResolveReferenceToAsset (const ConfigNode &node, const std::string &type) const
 
template<typename AssetInterfaceType >
AssetInterfaceType * ResolveReferenceToAsset (const ConfigNode &node) const
 
template<typename AssetInterfaceType >
LM_NAMESPACE_BEGIN bool RegisterInterface ()
 
- Public Member Functions inherited from Component
virtual std::string ComponentInterfaceTypeName () const =0
 
virtual std::string ComponentImplTypeName () const =0
 
- Public Member Functions inherited from SIMDAlignedType
void * operator new (std::size_t size) throw (std::bad_alloc)
 
void operator delete (void *p)
 

Detailed Description

An entry for the asset factory. This structure is used for registering asset factory to Assets class.

See also
Assets::RegisterAssetFactory
Inheritance diagram for AssetsImpl:
Assets Component SIMDAlignedType

Member Function Documentation

virtual boost::signals2::connection AssetsImpl::Connect_ReportProgress ( const std::function< void(double, bool)> &  func)
inlineoverridevirtual

Connect to ReportProgress signal. The signal is emitted when the progress of asset loading is changed.

Parameters
funcSlot function.

Implements Assets.

Asset * AssetsImpl::GetAssetByName ( const std::string &  name) const
overridevirtual

Get an asset by name. Returns nullptr if not found.

Parameters
nameName of the asset.
Returns
Asset instance.

Implements Assets.

bool AssetsImpl::Load ( const ConfigNode node)
overridevirtual

Load assets from XML element. Parse the element #node and register assets.

Parameters
nodeA XML element which consists of the assets element.
Return values
trueSucceeded to load assets.
falseFailed to load assets.

Implements Assets.

bool AssetsImpl::RegisterInterface ( const std::string &  interfaceName,
const std::string &  interfaceGroupName,
const std::vector< std::string > &  dependencies 
)
overridevirtual

Register an interface for assets. Register an component interface class for assets creation. The class must inherit Assets and specify dependencies to the other asset types with LM_ASSET_DEPENDENCIES macro. Fails if the factory with same name is already registered.

Parameters
interfaceNameName of component interface class which is inherited from Asset.
interfaceGroupNameName of interface group. e.g. triangle_meshes for triangle_mesh type.
dependenciesDependent asset interface names.
Return values
trueSucceeded to register.
falseFailed to register.
See also
LM_ASSET_DEPENDENCIES

Implements Assets.


The documentation for this class was generated from the following file: