Lightmetrica
0.0.1.50dbee3 (yosakoi)
|
#include <assets.h>
Public Member Functions | |
LM_COMPONENT_INTERFACE_DEF ("assets") | |
virtual bool | Load (const ConfigNode &node)=0 |
virtual Asset * | GetAssetByName (const std::string &name) const =0 |
virtual boost::signals2::connection | Connect_ReportProgress (const std::function< void(double, bool)> &func)=0 |
virtual bool | RegisterInterface (const std::string &interfaceName, const std::string &interfaceGroupName, const std::vector< std::string > &dependencies)=0 |
template<typename AssetInterfaceType > | |
bool | RegisterInterface () |
LM_PUBLIC_API Asset * | ResolveReferenceToAsset (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) |
Collection of assets. The asset collection class for the asset management.
|
pure virtual |
Connect to ReportProgress signal. The signal is emitted when the progress of asset loading is changed.
func | Slot function. |
Implemented in AssetsImpl.
|
pure virtual |
Get an asset by name. Returns nullptr if not found.
name | Name of the asset. |
Implemented in AssetsImpl, and StubAssets.
|
pure virtual |
Load assets from XML element. Parse the element #node and register assets.
node | A XML element which consists of the assets element. |
true | Succeeded to load assets. |
false | Failed to load assets. |
Implemented in AssetsImpl, and StubAssets.
|
pure virtual |
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.
interfaceName | Name of component interface class which is inherited from Asset. |
interfaceGroupName | Name of interface group. e.g. triangle_meshes for triangle_mesh type. |
dependencies | Dependent asset interface names. |
true | Succeeded to register. |
false | Failed to register. |
Implemented in AssetsImpl, and StubAssets.
bool Assets::RegisterInterface | ( | ) |
Register an interface for assets. Register an component interface class for assets creation. This template version statically checks the requirement for types.
AssetInterfaceType | Type of component interface class which is inherited from Asset. |
true | Succeeded to register. |
false | Failed to register. |
Asset * Assets::ResolveReferenceToAsset | ( | const ConfigNode & | node, |
const std::string & | type | ||
) | const |
Resolve reference to the asset. Resolve reference to an asset using ref attribute. Returns nullptr if ref attribute is not found.
node | A XML element which consists of the ref attribute. |
type | Target asset type, e.g. triangle_mesh. |
AssetInterfaceType * Assets::ResolveReferenceToAsset | ( | const ConfigNode & | node | ) | const |
Resolve reference to the asset. Template version of ResolveReferenceToAsset.
AssetInterfaceType | Asset interface type. |
node | A XML element which consists of the ref attribute. |