neuray API Programmer's Manual

mi::neuraylib::IUser_class_factory Class Reference

[Extensions and Plugins]

Description

Abstract interface for user class factories. The registration of a user-defined class requires a factory which constructs an instance of the class. The factory is passed during class registration, see mi::neuraylib::IDice_configuration::register_serializable_class().

Public Member Functions

virtual base::​IInterfacecreate( ITransaction* transaction, Uint32 argc, const base::​IInterface* argv) =0
Creates an instance of the class for which the factory was registered. More...

Member Functions

virtual base::​IInterface* mi::​neuraylib::​IUser_class_factory::create( ITransaction* transaction, Uint32 argc, const base::​IInterface* argv) [pure virtual]

Creates an instance of the class for which the factory was registered. Each class factory is free to decide which values and types of argc and argv are valid. However, it must handle the case transaction = NULL, argc = 0, and argv = NULL which is needed for deserialization.

Parameters

transaction
The transaction in which the instance is created. The transaction can be passed to the class constructor in case you want to create other class instances. Note that the transaction pointer must not be serialized/deserialized
argc
The size of the argv array.
argv
An array of optional arguments.

Returns

An instance of the class, or NULL on failure.