DiCE API nvidia_logo_transpbg.gif Up
iplugin_api.h
Go to the documentation of this file.
1/***************************************************************************************************
2 * Copyright 2023 NVIDIA Corporation. All rights reserved.
3 **************************************************************************************************/
6
7#ifndef MI_NEURAYLIB_IPLUGIN_API_H
8#define MI_NEURAYLIB_IPLUGIN_API_H
9
11
12namespace mi {
13
14namespace base { class ILogger; }
15
16namespace neuraylib {
17
25class IPlugin_api : public
26 mi::base::Interface_declare<0xf237d52c,0xf146,0x40e4,0xb0,0x35,0x99,0xcb,0xc9,0x77,0x64,0x6e>
27{
28public:
32 virtual Uint32 get_interface_version() const = 0;
33
38 virtual const char* get_version() const = 0;
39
50 virtual base::IInterface* get_api_component( const base::Uuid& uuid) const = 0;
51
64 template<class T>
66 {
67 base::IInterface* ptr_iinterface = get_api_component( typename T::IID());
68 if ( !ptr_iinterface)
69 return 0;
70 T* ptr_T = static_cast<T*>( ptr_iinterface->get_interface( typename T::IID()));
71 ptr_iinterface->release();
72 return ptr_T;
73 }
74
89 const base::Uuid& uuid, base::IInterface* api_component) = 0;
90
105 template<class T>
107 {
108 return register_api_component( typename T::IID(), api_component);
109 }
110
119 virtual Sint32 unregister_api_component( const base::Uuid& uuid) = 0;
120
132 template<class T>
134 {
135 return unregister_api_component( typename T::IID());
136 }
137};
138 // end group mi_neuray_plugins
140
141} // namespace neuraylib
142
143} // namespace mi
144
145#endif // MI_NEURAYLIB_IPLUGIN_API_H
The basic extensible interface.
Definition: iinterface.h:103
Mixin class template for deriving new interface declarations.
Definition: interface_declare.h:43
This abstract interface gives access to the DiCE API to plugins.
Definition: iplugin_api.h:27
Sint32 unregister_api_component()
Unregisters an API component with the DiCE API.
Definition: iplugin_api.h:133
virtual base::IInterface * get_api_component(const base::Uuid &uuid) const =0
Returns an API component from the DiCE API.
virtual const char * get_version() const =0
Returns the product version of the DiCE library.
virtual Sint32 unregister_api_component(const base::Uuid &uuid)=0
Unregisters an API component with the DiCE API.
T * get_api_component() const
Returns an API component from the DiCE API.
Definition: iplugin_api.h:65
virtual Uint32 get_interface_version() const =0
Returns the interface version of the DiCE library.
Sint32 register_api_component(T *api_component)
Registers an API component with the DiCE API.
Definition: iplugin_api.h:106
virtual Sint32 register_api_component(const base::Uuid &uuid, base::IInterface *api_component)=0
Registers an API component with the DiCE API.
virtual const IInterface * get_interface(const Uuid &interface_id) const =0
Acquires a const interface from another.
virtual Uint32 release() const =0
Decrements the reference count.
unsigned int Uint32
32-bit unsigned integer.
Definition: types.h:49
signed int Sint32
32-bit signed integer.
Definition: types.h:46
Mixin class template for deriving new interface declarations.
Common namespace for APIs of NVIDIA Advanced Rendering Center GmbH.
Definition: dice.h:89
A 128 bit representation of a universally unique identifier (UUID or GUID).
Definition: uuid.h:26