NVIDIA Iray API Home  Up
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
mi::neuraylib::IUser_class_factory Class Referenceabstract

Abstract interface for user class factories. More...

Inheritance diagram for mi::neuraylib::IUser_class_factory:
Inheritance graph
[legend]

Public Member Functions

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

Additional Inherited Members

- Public Types inherited from mi::base::Interface_declare< 0x37355ece, 0x2ed7, 0x4158, 0x88, 0x35, 0xb8, 0x60, 0xaf, 0x75, 0x6a, 0x64 >
typedef Interface_declare< id1,
id2, id3, id4, id5, id6, id7,
id8, id9, id10, id11,
IInterface
Self
  Own type. More...
 
typedef Uuid_t< id1, id2, id3,
id4, id5, id6, id7, id8, id9,
id10, id11 > 
IID
  Declares the interface ID (IID) of this interface. More...
 
- Static Public Member Functions inherited from mi::base::Interface_declare< 0x37355ece, 0x2ed7, 0x4158, 0x88, 0x35, 0xb8, 0x60, 0xaf, 0x75, 0x6a, 0x64 >
static bool  compare_iid (const Uuid &iid)
  Compares the interface ID iid against the interface ID of this interface and of its ancestors. More...
 

Detailed 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::IExtension_api::register_class().

Member Function Documentation

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. In that case, the method mi::neuraylib::ISerializable::deserialize() is called afterwards.

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 and it must not be used in mi::neuraylib::IUser_class::copy() (because the copy might live in another transaction).
argc The size of the argv array.
argv An array of optional arguments.
Returns
An instance of the class, or NULL on failure.

Implemented in mi::neuraylib::User_class_factory< T >.