Base API nvidia_logo_transpbg.gif Up
plugin.h
Go to the documentation of this file.
1/***************************************************************************************************
2 * Copyright 2023 NVIDIA Corporation. All rights reserved.
3 **************************************************************************************************/
6
7#include <mi/base/types.h>
9
10#ifndef MI_BASE_PLUGIN_H
11#define MI_BASE_PLUGIN_H
12
13namespace mi {
14
15namespace base {
16
33class Plugin
34{
35public:
36 // The currently used plugin system version.
37 static const Sint32 s_version = 3;
38
46 virtual Sint32 get_plugin_system_version() const { return s_version; }
47
49 virtual const char* get_name() const = 0;
50
54 virtual const char* get_type() const = 0;
55
57 virtual Sint32 get_version() const { return 1; }
58
60 virtual const char* get_compiler() const { return "unknown"; }
61
67 virtual void release() = 0;
68
78 virtual const char* get_string_property(
79 Sint32 index,
80 const char** value) { (void) index; (void) value; return 0; }
81
82};
83
89class IPlugin_descriptor : public
90 mi::base::Interface_declare<0x1708ae5a,0xa49e,0x43c4,0xa3,0x94,0x00,0x38,0x4c,0x59,0xe8,0x67>
91{
92public:
99 virtual base::Plugin* get_plugin() const = 0;
100
104 virtual const char* get_plugin_library_path() const = 0;
105};
106
115#ifndef MI_FOR_DOXYGEN_ONLY
116typedef Plugin* Plugin_factory (unsigned int /*index*/, void* /*context*/);
117#else
118typedef Plugin* Plugin_factory (unsigned int index, void* context);
119#endif
120 // end group mi_base_plugin
122
123} // namespace base
124
125} // namespace mi
126
127#endif // MI_BASE_PLUGIN_H
Represents a plugin.
Definition: plugin.h:91
Mixin class template for deriving new interface declarations.
Definition: interface_declare.h:43
The abstract base class for plugins.
Definition: plugin.h:34
virtual const char * get_plugin_library_path() const =0
Returns the library path of the plugin.
virtual Sint32 get_plugin_system_version() const
Returns the version of the plugin system used to compile this.
Definition: plugin.h:46
virtual const char * get_name() const =0
Returns the name of the plugin.
virtual base::Plugin * get_plugin() const =0
Returns the plugin itself.
Plugin * Plugin_factory(unsigned int index, void *context)
Typedef for the initializer function to be provided by every plugin.
Definition: plugin.h:118
virtual const char * get_type() const =0
Returns the type of the plugin.
virtual const char * get_string_property(Sint32 index, const char **value)
Returns a plugin property.
Definition: plugin.h:78
virtual Sint32 get_version() const
Returns the version number of the plugin.
Definition: plugin.h:57
virtual void release()=0
Destroys the plugin instance.
virtual const char * get_compiler() const
Returns the compiler used to compile the plugin.
Definition: plugin.h:60
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: base.h:34
Basic types.