MDL SDK API nvidia_logo_transpbg.gif Up
mi::neuraylib::IModule Class Referenceabstract

This interface represents an MDL module. More...

#include <imodule.h>

Inheritance diagram for mi::neuraylib::IModule:

Public Member Functions

virtual const char * get_filename () const =0
 Returns the name of the MDL source file from which this module was created. More...
 
virtual const char * get_mdl_name () const =0
 Returns the MDL name of the module. More...
 
virtual Size get_mdl_package_component_count () const =0
 Returns the number of package components in the MDL name. More...
 
virtual const char * get_mdl_package_component_name (Size index) const =0
 Returns the name of a package component in the MDL name. More...
 
virtual const char * get_mdl_simple_name () const =0
 Returns the simple MDL name of the module. More...
 
virtual Mdl_version get_mdl_version () const =0
 Returns the MDL version of this module. More...
 
virtual Size get_import_count () const =0
 Returns the number of modules imported by the module. More...
 
virtual const char * get_import (Size index) const =0
 Returns the DB name of the imported module at index. More...
 
virtual const IType_listget_types () const =0
 Returns the types exported by this module. More...
 
virtual const IValue_listget_constants () const =0
 Returns the constants exported by this module. More...
 
virtual Size get_function_count () const =0
 Returns the number of function definitions exported by the module. More...
 
virtual const char * get_function (Size index) const =0
 Returns the DB name of the function definition at index. More...
 
virtual Size get_material_count () const =0
 Returns the number of material definitions exported by the module. More...
 
virtual const char * get_material (Size index) const =0
 Returns the DB name of the material definition at index. More...
 
virtual Size get_resources_count () const =0
 Returns the number of resources defined in the module. More...
 
virtual const IValue_resourceget_resource (Size index) const =0
 Returns a resource defined in the module. More...
 
virtual Size get_annotation_definition_count () const =0
 Returns the number of annotations defined in the module. More...
 
virtual const IAnnotation_definitionget_annotation_definition (Size index) const =0
 Returns the annotation definition at index. More...
 
virtual const IAnnotation_definitionget_annotation_definition (const char *name) const =0
 Returns the annotation definition of the given name. More...
 
virtual const IAnnotation_blockget_annotations () const =0
 Returns the annotations of the module, or NULL if there are no such annotations. More...
 
virtual bool is_standard_module () const =0
 Indicates whether this module is a standard module. More...
 
virtual bool is_mdle_module () const =0
 Indicates whether this module results from an .mdle file. More...
 
virtual const IArrayget_function_overloads (const char *name, const IExpression_list *arguments=0) const =0
 Returns overloads of a function or material definition. More...
 
virtual const IArrayget_function_overloads (const char *name, const IArray *parameter_types) const =0
 Returns overloads of a function or material definition. More...
 
virtual bool is_valid (IMdl_execution_context *context) const =0
 Returns true if all imports of the module are valid. More...
 
virtual Sint32 reload (bool recursive, IMdl_execution_context *context)=0
 Reload the module from disk. More...
 
virtual Sint32 reload_from_string (const char *module_source, bool recursive, IMdl_execution_context *context)=0
 Reload the module from string. More...
 
- Public Member Functions inherited from mi::neuraylib::IScene_element
virtual Element_type get_element_type () const =0
 Indicates the actual scene element represented by interfaces derived from this interface. More...
 
- Public Member Functions inherited from mi::neuraylib::IAttribute_set
virtual IDatacreate_attribute (const char *name, const char *type)=0
 Creates a new attribute name of the type type. More...
 
template<class T>
T * create_attribute (const char *name, const char *type)
 Creates a new attribute name of the type type. More...
 
template<class T>
T * create_attribute (const char *name)
 Creates a new attribute name of the type T. More...
 
virtual bool destroy_attribute (const char *name)=0
 Destroys the attribute name. More...
 
virtual const IDataaccess_attribute (const char *name) const =0
 Returns a const pointer to the attribute name. More...
 
template<class T>
const T * access_attribute (const char *name) const
 Returns a const pointer to the attribute name. More...
 
virtual IDataedit_attribute (const char *name)=0
 Returns a mutable pointer to the attribute name. More...
 
template<class T>
T * edit_attribute (const char *name)
 Returns a mutable pointer to the attribute name. More...
 
virtual bool is_attribute (const char *name) const =0
 Indicates existence of an attribute. More...
 
virtual const char * get_attribute_type_name (const char *name) const =0
 Returns the type of an attribute. More...
 
virtual Sint32 set_attribute_propagation (const char *name, Propagation_type value)=0
 Sets the propagation type of the attribute name. More...
 
virtual Propagation_type get_attribute_propagation (const char *name) const =0
 Returns the propagation type of the attribute name. More...
 
virtual const char * enumerate_attributes (Sint32 index) const =0
 Returns the name of the attribute indicated by index. More...
 
- Public Member Functions inherited from mi::base::IInterface
virtual Uint32 retain () const =0
 Increments the reference count. More...
 
virtual Uint32 release () const =0
 Decrements the reference count. More...
 
virtual const IInterfaceget_interface (const Uuid &interface_id) const =0
 Acquires a const interface from another. More...
 
template<class T>
const T * get_interface () const
 Acquires a const interface from another. More...
 
virtual IInterfaceget_interface (const Uuid &interface_id)=0
 Acquires a mutable interface from another. More...
 
template<class T>
T * get_interface ()
 Acquires a mutable interface from another. More...
 
virtual Uuid get_iid () const =0
 Returns the interface ID of the most derived interface. More...
 

Additional Inherited Members

- Public Types inherited from mi::base::Interface_declare< 0xe283b0ee, ... >
typedef Interface_declare< id1, ... > Self
 Own type. More...
 
typedef Uuid_t< id1, ... > IID
 Declares the interface ID (IID) of this interface. More...
 
- Public Types inherited from mi::base::Interface_declare< 0x8a2a4da9, ... >
typedef Interface_declare< id1, ... > Self
 Own type. More...
 
typedef Uuid_t< id1, ... > IID
 Declares the interface ID (IID) of this interface. More...
 
- Public Types inherited from mi::base::Interface_declare< 0x1bcb8d48, ... >
typedef Interface_declare< id1, ... > Self
 Own type. More...
 
typedef Uuid_t< id1, ... > IID
 Declares the interface ID (IID) of this interface. More...
 
- Public Types inherited from mi::base::IInterface
typedef Uuid_t<0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0> IID
 Declares the interface ID (IID) of this interface. More...
 
- Static Public Member Functions inherited from mi::base::Interface_declare< 0xe283b0ee, ... >
static bool compare_iid (const Uuid &iid)
 Compares the interface ID iid against the interface ID of this interface and of its ancestors. More...
 
- Static Public Member Functions inherited from mi::base::Interface_declare< 0x8a2a4da9, ... >
static bool compare_iid (const Uuid &iid)
 Compares the interface ID iid against the interface ID of this interface and of its ancestors. More...
 
- Static Public Member Functions inherited from mi::base::Interface_declare< 0x1bcb8d48, ... >
static bool compare_iid (const Uuid &iid)
 Compares the interface ID iid against the interface ID of this interface and of its ancestors. More...
 
- Static Public Member Functions inherited from mi::base::IInterface
static bool compare_iid (const Uuid &iid)
 Compares the interface ID iid against the interface ID of this interface. More...
 

Detailed Description

This interface represents an MDL module.

See also
mi::neuraylib::IFunction_definition, mi::neuraylib::IFunction_call

Member Function Documentation

 get_annotation_definition() [1/2]

virtual const IAnnotation_definition * mi::neuraylib::IModule::get_annotation_definition ( const char *  name) const
pure virtual

Returns the annotation definition of the given name.

Parameters
nameThe name of the annotation definition.
Returns
The annotation definition or NULL if there is no such definition.

 get_annotation_definition() [2/2]

virtual const IAnnotation_definition * mi::neuraylib::IModule::get_annotation_definition ( Size  index) const
pure virtual

Returns the annotation definition at index.

Parameters
indexThe index of the annotation definition.
Returns
The annotation definition or NULL if index is out of range.

 get_annotation_definition_count()

virtual Size mi::neuraylib::IModule::get_annotation_definition_count ( ) const
pure virtual

Returns the number of annotations defined in the module.

 get_annotations()

virtual const IAnnotation_block * mi::neuraylib::IModule::get_annotations ( ) const
pure virtual

Returns the annotations of the module, or NULL if there are no such annotations.

 get_constants()

virtual const IValue_list * mi::neuraylib::IModule::get_constants ( ) const
pure virtual

Returns the constants exported by this module.

 get_filename()

virtual const char * mi::neuraylib::IModule::get_filename ( ) const
pure virtual

Returns the name of the MDL source file from which this module was created.

Returns
The full pathname of the source file from which this MDL module was created, or NULL if no such file exists.

 get_function()

virtual const char * mi::neuraylib::IModule::get_function ( Size  index) const
pure virtual

Returns the DB name of the function definition at index.

Parameters
indexThe index of the function definition.
Returns
The DB name of the function definition. The method may return NULL for valid indices if the corresponding function definition has already been removed from the DB.

 get_function_count()

virtual Size mi::neuraylib::IModule::get_function_count ( ) const
pure virtual

Returns the number of function definitions exported by the module.

 get_function_overloads() [1/2]

virtual const IArray * mi::neuraylib::IModule::get_function_overloads ( const char *  name,
const IArray parameter_types 
) const
pure virtual

Returns overloads of a function or material definition.

The method returns the best-matching overloads of a function or material definition of this module, given a list of positional parameter types.

Note
This overload should only be used if no actual arguments are available. If arguments are available, consider using get_function_overloads(const char*,const IExpression_list*)constinstead.
This method does not work for the function definitions with the following semantics:
Parameters
nameThe simple name or the DB name without signature of a function or material definition from this module.
parameter_typesA static or dynamic array with elements of type mi::IString representing positional parameter type names as returned by mi::neuraylib::IFunction_definition::get_mdl_parameter_type_name().
Returns
The DB names of overloads of the given function or material definition, or NULL if name is invalid.

 get_function_overloads() [2/2]

virtual const IArray * mi::neuraylib::IModule::get_function_overloads ( const char *  name,
const IExpression_list arguments = 0 
) const
pure virtual

Returns overloads of a function or material definition.

The method returns overloads of a function or material definition of this module, either all overloads or just the overloads matching a given set of arguments.

Parameters
nameThe simple name or the DB name without signature of a function or material definition from this module.
argumentsOptional arguments to select specific overload(s). If present, the method returns only the overloads of name whose signature matches the provided arguments, i.e., a call to mi::neuraylib::IFunction_definition::create_function_call() with these arguments would succeed.
Returns
The DB names of overloads of the given function or material definition, or NULL if name is invalid.

 get_import()

virtual const char * mi::neuraylib::IModule::get_import ( Size  index) const
pure virtual

Returns the DB name of the imported module at index.

Parameters
indexThe index of the imported module.
Returns
The DB name of the imported module.

 get_import_count()

virtual Size mi::neuraylib::IModule::get_import_count ( ) const
pure virtual

Returns the number of modules imported by the module.

 get_material()

virtual const char * mi::neuraylib::IModule::get_material ( Size  index) const
pure virtual

Returns the DB name of the material definition at index.

Parameters
indexThe index of the material definition.
Returns
The DB name of the material definition. The method may return NULL for valid indices if the corresponding material definition has already been removed from the DB.

 get_material_count()

virtual Size mi::neuraylib::IModule::get_material_count ( ) const
pure virtual

Returns the number of material definitions exported by the module.

 get_mdl_name()

virtual const char * mi::neuraylib::IModule::get_mdl_name ( ) const
pure virtual

Returns the MDL name of the module.

Note
The MDL name of the module is different from the name of the DB element. Use mi::neuraylib::ITransaction::name_of() to obtain the name of the DB element.
Returns
The MDL name of the module.

 get_mdl_package_component_count()

virtual Size mi::neuraylib::IModule::get_mdl_package_component_count ( ) const
pure virtual

Returns the number of package components in the MDL name.

 get_mdl_package_component_name()

virtual const char * mi::neuraylib::IModule::get_mdl_package_component_name ( Size  index) const
pure virtual

Returns the name of a package component in the MDL name.

Returns
The index -th package component name, or NULL if index is out of bounds.

 get_mdl_simple_name()

virtual const char * mi::neuraylib::IModule::get_mdl_simple_name ( ) const
pure virtual

Returns the simple MDL name of the module.

The simple name is the last component of the MDL name, i.e., without any packages and scope qualifiers.

Returns
The simple MDL name of the module.

 get_mdl_version()

virtual Mdl_version mi::neuraylib::IModule::get_mdl_version ( ) const
pure virtual

Returns the MDL version of this module.

 get_resource()

virtual const IValue_resource * mi::neuraylib::IModule::get_resource ( Size  index) const
pure virtual

Returns a resource defined in the module.

Resources defined in a module that is imported by this module are not included.

 get_resources_count()

virtual Size mi::neuraylib::IModule::get_resources_count ( ) const
pure virtual

Returns the number of resources defined in the module.

Resources defined in a module that is imported by this module are not included.

 get_types()

virtual const IType_list * mi::neuraylib::IModule::get_types ( ) const
pure virtual

Returns the types exported by this module.

 is_mdle_module()

virtual bool mi::neuraylib::IModule::is_mdle_module ( ) const
pure virtual

Indicates whether this module results from an .mdle file.

 is_standard_module()

virtual bool mi::neuraylib::IModule::is_standard_module ( ) const
pure virtual

Indicates whether this module is a standard module.

Examples for standard modules are "limits", "anno", "state", "math", "tex", "noise", and "df".

 is_valid()

virtual bool mi::neuraylib::IModule::is_valid ( IMdl_execution_context context) const
pure virtual

Returns true if all imports of the module are valid.

Parameters
contextIn case of failure, the execution context can be checked for error messages. Can be NULL.

 reload()

virtual Sint32 mi::neuraylib::IModule::reload ( bool  recursive,
IMdl_execution_context context 
)
pure virtual

Reload the module from disk.

Note
This function works for file-based modules, only.
Parameters
contextIn case of failure, the execution context can be checked for error messages. Can be NULL.
recursiveIf true, all imported file-based modules are reloaded prior to this one.
Returns
  • 0: Success
  • -1: Reloading failed, check the context for details.

 reload_from_string()

virtual Sint32 mi::neuraylib::IModule::reload_from_string ( const char *  module_source,
bool  recursive,
IMdl_execution_context context 
)
pure virtual

Reload the module from string.

Note
This function works for string/memory-based modules, only. Standard modules and the built-in modules mdl::base and mdl::nvidia::distilling_support cannot be reloaded.
Parameters
module_sourceThe module source code.
recursiveIf true, all imported file-based modules are reloaded prior to this one.
contextIn case of failure, the execution context can be checked for error messages. Can be NULL.
Returns
  • 0: Success
  • -1: Reloading failed, check the context for details.