Kanzi  3.9.9
Kanzi Engine C++ API
kanzi::ObjectLoader Class Reference

ObjectLoader loads objects from KZB. More...

#include <kanzi/core.ui/kzb/object_loader.hpp>

Public Types

typedef function< ObjectSharedPtr(Domain *, string_view, KzbFile &, KzbMemoryParser &)> LoadFunction
 

Public Member Functions

bool isLoadingEnabled (const Metaclass *metaclass) const
 Indicates whether loading for objects with specified metaclass is possible via this object loader. More...
 
ObjectSharedPtr loadObject (Domain *domain, const Metaclass *metaclass, string_view name, KzbFile &kzbFile, KzbMemoryParser &parser)
 Loads object by metaclass from KZB. More...
 
 ObjectLoader ()
 Constructor. More...
 
void registerObjectLoadFunction (const Metaclass *metaclass, LoadFunction loadFunction)
 Registers object load functions by metaclass. More...
 

Detailed Description

ObjectLoader loads objects from KZB.

Member Typedef Documentation

Constructor & Destructor Documentation

kanzi::ObjectLoader::ObjectLoader ( )
explicit

Constructor.

Member Function Documentation

void kanzi::ObjectLoader::registerObjectLoadFunction ( const Metaclass metaclass,
LoadFunction  loadFunction 
)

Registers object load functions by metaclass.

Functions might return objects whose type is different from the type specified by metaclass.

Parameters
metaclassMetaclass of object to load.
loadFunctionFunction to load object from KZB.
ObjectSharedPtr kanzi::ObjectLoader::loadObject ( Domain domain,
const Metaclass metaclass,
string_view  name,
KzbFile kzbFile,
KzbMemoryParser parser 
)

Loads object by metaclass from KZB.

Returned object might have different type than type specified by metaclass.

Parameters
domainDomain to use when loading object.
metaclassMetaclass of object to load.
nameName of object to load.
kzbFileKZB to load object from.
parserParser to parse object data from.
Returns
Loaded object.
bool kanzi::ObjectLoader::isLoadingEnabled ( const Metaclass metaclass) const

Indicates whether loading for objects with specified metaclass is possible via this object loader.

Parameters
metaclassObject metaclass.
Returns
true if loading is possible, false otherwise.

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