Kanzi Graphics Engine
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
kzu_factory.h File Reference

Implements a factory object that can be used to create instances of runtime-registered classes by their type. More...

Typedefs

typedef kzsError(* kzuFactoryObjectNodeCreateFunction )(const struct KzcMemoryManager *memoryManager, kzString name, struct KzuUIDomain *uiDomain, struct KzuObjectNode **out_objectNode)
 Pointer to a function that creates an object node with its default parameters. More...
 
typedef kzsError(* kzuFactoryResourceCreateFunction )(const struct KzcMemoryManager *memoryManager, kzString name, struct KzuResourceLoader *loader, struct KzuUIDomain *uiDomain, struct KzuResource **out_resource)
 Pointer to a function that creates a resource with its default parameters. More...
 
typedef kzsError(* kzuFactoryObjectGeneratorCreateFunction )(const struct KzcMemoryManager *memoryManager, struct KzuUIDomain *uiDomain, struct KzuObjectGenerator **out_generator)
 Pointer to a function that creates an object generator with its default parameters. More...
 
typedef kzsError(* kzuFactoryItemContainerGeneratorCreateFunction )(const struct KzcMemoryManager *memoryManager, struct KzuUIDomain *uiDomain, struct KzuItemGenerator **out_generator)
 Pointer to a function that creates an item container generator with its default parameters. More...
 

Functions

kzsError kzuFactoryCreate (const struct KzcMemoryManager *memoryManager, struct KzuFactory **out_factory)
 Creates a factory. More...
 
kzsError kzuFactoryDelete (struct KzuFactory *factory)
 Deletes a factory. More...
 
kzsError kzuFactoryRegisterObjectNodeType (const struct KzuFactory *factory, KzuObjectType objectType, kzString typeString, kzuFactoryObjectNodeCreateFunction createFunction)
 Registers an object node type to the factory. More...
 
kzsError kzuFactoryRegisterResourceType (const struct KzuFactory *factory, KzuResourceType resourceType, kzString typeString, kzuFactoryResourceCreateFunction createFunction)
 Registers a resource type to the factory. More...
 
kzsError kzuFactoryRegisterObjectGeneratorType (const struct KzuFactory *factory, KzuObjectGeneratorType generatorType, kzString typeString, kzuFactoryObjectGeneratorCreateFunction createFunction)
 Registers an object generator type to the factory. More...
 
kzsError kzuFactoryRegisterItemContainerGeneratorType (const struct KzuFactory *factory, KzuItemContainerGeneratorType generatorType, kzString typeString, kzuFactoryItemContainerGeneratorCreateFunction createFunction)
 Registers an item container generator type to the factory. More...
 
kzsException kzuFactoryGetObjectTypeName (const struct KzuFactory *factory, const void *objectType, kzString *out_string)
 Gets object type's name by its type identifier. More...
 
kzsException kzuFactoryGetObjectType (const struct KzuFactory *factory, kzString objectTypeName, const void **out_objectType)
 Gets object type's type identifier by its name. More...
 
kzsException kzuFactoryCreateObjectNode (const struct KzuFactory *factory, const struct KzcMemoryManager *memoryManager, kzString name, struct KzuUIDomain *uiDomain, KzuObjectType objectType, struct KzuObjectNode **out_objectNode)
 Creates and initializes an object node of the given type. More...
 
kzsException kzuFactoryCreateUninitializedObjectNode (const struct KzuFactory *factory, const struct KzcMemoryManager *memoryManager, kzString name, struct KzuUIDomain *uiDomain, KzuObjectType objectType, struct KzuObjectNode **out_objectNode)
 Creates an object of the given type without initializing. More...
 
kzsException kzuFactoryCreateResource (const struct KzuFactory *factory, const struct KzcMemoryManager *memoryManager, kzString name, struct KzuResourceLoader *loader, struct KzuUIDomain *uiDomain, KzuResourceType resourceType, struct KzuResource **out_resource)
 Creates and initializes a resource with its default settings. More...
 
kzsException kzuFactoryCreateObjectGenerator (const struct KzuFactory *factory, const struct KzcMemoryManager *memoryManager, struct KzuUIDomain *uiDomain, KzuObjectGeneratorType objectGeneratorType, struct KzuObjectGenerator **out_generator)
 Creates and initializes an object generator with its default settings. More...
 
kzsException kzuFactoryCreateItemContainerGenerator (const struct KzuFactory *factory, const struct KzcMemoryManager *memoryManager, struct KzuUIDomain *uiDomain, KzuItemContainerGeneratorType itemContainerGeneratorType, struct KzuItemGenerator **out_generator)
 Creates and initializes an item container generator with its default settings. More...
 
kzsException kzuFactoryLoadObjectTypeFromKZB (const struct KzuFactory *factory, struct KzcInputStream *inputStream, const void **out_objectType)
 Load factory object type. More...
 

Detailed Description

Implements a factory object that can be used to create instances of runtime-registered classes by their type.

Copyright 2008-2019 by Rightware. All rights reserved.

Typedef Documentation

typedef kzsError(* kzuFactoryObjectNodeCreateFunction)(const struct KzcMemoryManager *memoryManager, kzString name, struct KzuUIDomain *uiDomain, struct KzuObjectNode **out_objectNode)

Pointer to a function that creates an object node with its default parameters.

typedef kzsError(* kzuFactoryResourceCreateFunction)(const struct KzcMemoryManager *memoryManager, kzString name, struct KzuResourceLoader *loader, struct KzuUIDomain *uiDomain, struct KzuResource **out_resource)

Pointer to a function that creates a resource with its default parameters.

typedef kzsError(* kzuFactoryObjectGeneratorCreateFunction)(const struct KzcMemoryManager *memoryManager, struct KzuUIDomain *uiDomain, struct KzuObjectGenerator **out_generator)

Pointer to a function that creates an object generator with its default parameters.

typedef kzsError(* kzuFactoryItemContainerGeneratorCreateFunction)(const struct KzcMemoryManager *memoryManager, struct KzuUIDomain *uiDomain, struct KzuItemGenerator **out_generator)

Pointer to a function that creates an item container generator with its default parameters.

Function Documentation

kzsError kzuFactoryCreate ( const struct KzcMemoryManager memoryManager,
struct KzuFactory **  out_factory 
)

Creates a factory.

kzsError kzuFactoryDelete ( struct KzuFactory factory)

Deletes a factory.

kzsError kzuFactoryRegisterObjectNodeType ( const struct KzuFactory factory,
KzuObjectType  objectType,
kzString  typeString,
kzuFactoryObjectNodeCreateFunction  createFunction 
)

Registers an object node type to the factory.

kzsError kzuFactoryRegisterResourceType ( const struct KzuFactory factory,
KzuResourceType  resourceType,
kzString  typeString,
kzuFactoryResourceCreateFunction  createFunction 
)

Registers a resource type to the factory.

kzsError kzuFactoryRegisterObjectGeneratorType ( const struct KzuFactory factory,
KzuObjectGeneratorType  generatorType,
kzString  typeString,
kzuFactoryObjectGeneratorCreateFunction  createFunction 
)

Registers an object generator type to the factory.

kzsError kzuFactoryRegisterItemContainerGeneratorType ( const struct KzuFactory factory,
KzuItemContainerGeneratorType  generatorType,
kzString  typeString,
kzuFactoryItemContainerGeneratorCreateFunction  createFunction 
)

Registers an item container generator type to the factory.

kzsException kzuFactoryGetObjectTypeName ( const struct KzuFactory factory,
const void objectType,
kzString out_string 
)

Gets object type's name by its type identifier.

The returned string must not be freed manually.

kzsException kzuFactoryGetObjectType ( const struct KzuFactory factory,
kzString  objectTypeName,
const void **  out_objectType 
)

Gets object type's type identifier by its name.

kzsException kzuFactoryCreateObjectNode ( const struct KzuFactory factory,
const struct KzcMemoryManager memoryManager,
kzString  name,
struct KzuUIDomain uiDomain,
KzuObjectType  objectType,
struct KzuObjectNode **  out_objectNode 
)

Creates and initializes an object node of the given type.

kzsException kzuFactoryCreateUninitializedObjectNode ( const struct KzuFactory factory,
const struct KzcMemoryManager memoryManager,
kzString  name,
struct KzuUIDomain uiDomain,
KzuObjectType  objectType,
struct KzuObjectNode **  out_objectNode 
)

Creates an object of the given type without initializing.

Should not be used in applications.

kzsException kzuFactoryCreateResource ( const struct KzuFactory factory,
const struct KzcMemoryManager memoryManager,
kzString  name,
struct KzuResourceLoader loader,
struct KzuUIDomain uiDomain,
KzuResourceType  resourceType,
struct KzuResource **  out_resource 
)

Creates and initializes a resource with its default settings.

kzsException kzuFactoryCreateObjectGenerator ( const struct KzuFactory factory,
const struct KzcMemoryManager memoryManager,
struct KzuUIDomain uiDomain,
KzuObjectGeneratorType  objectGeneratorType,
struct KzuObjectGenerator **  out_generator 
)

Creates and initializes an object generator with its default settings.

kzsException kzuFactoryCreateItemContainerGenerator ( const struct KzuFactory factory,
const struct KzcMemoryManager memoryManager,
struct KzuUIDomain uiDomain,
KzuItemContainerGeneratorType  itemContainerGeneratorType,
struct KzuItemGenerator **  out_generator 
)

Creates and initializes an item container generator with its default settings.

kzsException kzuFactoryLoadObjectTypeFromKZB ( const struct KzuFactory factory,
struct KzcInputStream inputStream,
const void **  out_objectType 
)

Load factory object type.