DiCE API nvidia_logo_transpbg.gif Up
iuser_class_factory.h
Go to the documentation of this file.
1/***************************************************************************************************
2 * Copyright 2023 NVIDIA Corporation. All rights reserved.
3 **************************************************************************************************/
6
7#ifndef MI_NEURAYLIB_IUSER_CLASS_FACTORY_H
8#define MI_NEURAYLIB_IUSER_CLASS_FACTORY_H
9
12
13namespace mi {
14
15namespace neuraylib {
16
21class ITransaction;
22
29class IUser_class_factory : public
30 mi::base::Interface_declare<0x37355ece,0x2ed7,0x4158,0x88,0x35,0xb8,0x60,0xaf,0x75,0x6a,0x64>
31{
32public:
50 ITransaction* transaction,
51 Uint32 argc,
52 const base::IInterface* argv[]) = 0;
53};
54
63template <class T>
64class User_class_factory : public
65 mi::base::Interface_implement<neuraylib::IUser_class_factory>
66{
67public:
78 ITransaction* transaction,
79 Uint32 argc,
80 const base::IInterface* argv[])
81 {
82 // avoid warnings
83 (void) transaction;
84 (void) argc;
85 (void) argv;
86
87 if( argc != 0)
88 return 0;
89 return new T;
90 }
91};
92 // end group mi_neuray_plugins
94
95} // namespace neuraylib
96
97} // namespace mi
98
99#endif // MI_NEURAYLIB_IUSER_CLASS_FACTORY_H
The basic extensible interface.
Definition: iinterface.h:103
Mixin class template for deriving new interface declarations.
Definition: interface_declare.h:43
Mixin class template for deriving interface implementations.
Definition: interface_implement.h:41
Abstract interface for user class factories.
Definition: iuser_class_factory.h:31
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.
This mixin class provides a default implementation of the IUser_class_factory interface.
Definition: iuser_class_factory.h:66
base::IInterface * create(ITransaction *transaction, Uint32 argc, const base::IInterface *argv[])
Creates an instance of the class for which the factory was registered.
Definition: iuser_class_factory.h:77
unsigned int Uint32
32-bit unsigned integer.
Definition: types.h:49
Mixin class template for deriving new interface declarations.
Mixin class template for deriving interface implementations.
Common namespace for APIs of NVIDIA Advanced Rendering Center GmbH.
Definition: dice.h:89