Material Definition Language API nvidia_logo_transpbg.gif Up
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
mi::neuraylib::IFunction_call Class Referenceabstract

This interface represents a function call. More...

Inheritance diagram for mi::neuraylib::IFunction_call:
mi::base::Interface_declare< 0x67b29f5f, 0xdbc1, 0x4300, 0x94, 0x53, 0x3e, 0x2d, 0x28, 0x29, 0xc1, 0xe9, neuraylib::IScene_element > mi::neuraylib::IScene_element mi::base::Interface_declare< 0x8a2a4da9, 0xe323, 0x452c, 0xb8, 0xda, 0x92, 0x45, 0x67, 0x85, 0xd7, 0x78, neuraylib::IAttribute_set > mi::neuraylib::IAttribute_set mi::base::Interface_declare< 0x1bcb8d48, 0x10c1, 0x4b3e, 0x9b, 0xfa, 0x06, 0x23, 0x61, 0x81, 0xd3, 0xe1 > mi::base::IInterface

Public Member Functions

virtual const char * get_function_definition () const =0
 Returns the DB name of the corresponding function definition. More...
 
virtual const char * get_mdl_function_definition () const =0
 Returns the MDL name of the corresponding function definition. More...
 
bool is_array_constructor () const
 Indicates whether this call is and instance of the array constructor. More...
 
virtual const ITypeget_return_type () const =0
 Returns the return type of the corresponding function definition. More...
 
virtual Size get_parameter_count () const =0
 Returns the number of parameters. More...
 
virtual const char * get_parameter_name (Size index) const =0
 Returns the name of the parameter at index. More...
 
virtual Size get_parameter_index (const char *name) const =0
 Returns the index position of a parameter. More...
 
virtual const IType_listget_parameter_types () const =0
 Returns the types of all parameters. More...
 
virtual const IExpression_listget_arguments () const =0
 Returns all arguments. More...
 
virtual Sint32 set_arguments (const IExpression_list *arguments)=0
 Sets multiple arguments. More...
 
virtual Sint32 set_argument (Size index, const IExpression *argument)=0
 Sets the argument at index. More...
 
virtual Sint32 set_argument (const char *name, const IExpression *argument)=0
 Sets an argument identified by name. More...
 

Additional Inherited Members

- Public Types inherited from mi::base::Interface_declare< 0x67b29f5f, 0xdbc1, 0x4300, 0x94, 0x53, 0x3e, 0x2d, 0x28, 0x29, 0xc1, 0xe9, neuraylib::IScene_element >
typedef Interface_declare< id1,
id2, id3, id4, id5, id6, id7,
id8, id9, id10, id11,
neuraylib::IScene_element
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< 0x67b29f5f, 0xdbc1, 0x4300, 0x94, 0x53, 0x3e, 0x2d, 0x28, 0x29, 0xc1, 0xe9, neuraylib::IScene_element >
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

This interface represents a function call.

A function call is an instance of a formal function definition, with a fixed set of arguments (possibly the defaults of the function definition). Function calls can be created from function definitions using mi::neuraylib::IFunction_definition::create_function_call().

See Also
mi::neuraylib::IFunction_definition, mi::neuraylib::Argument_editor

Member Function Documentation

virtual const IExpression_list* mi::neuraylib::IFunction_call::get_arguments ( ) const
pure virtual

Returns all arguments.

virtual const char* mi::neuraylib::IFunction_call::get_function_definition ( ) const
pure virtual

Returns the DB name of the corresponding function definition.

The type of the function definition is mi::neuraylib::IFunction_definition.

Note
The DB name of the function definition is different from its MDL name (see get_mdl_function_definition()).
virtual const char* mi::neuraylib::IFunction_call::get_mdl_function_definition ( ) const
pure virtual

Returns the MDL name of the corresponding function definition.

Note
The MDL name of the function definition is different from the name of the DB element (see get_function_definition()).
virtual Size mi::neuraylib::IFunction_call::get_parameter_count ( ) const
pure virtual

Returns the number of parameters.

virtual Size mi::neuraylib::IFunction_call::get_parameter_index ( const char *  name) const
pure virtual

Returns the index position of a parameter.

Parameters
nameThe name of the parameter.
Returns
The index of the parameter, or -1 if name is invalid.
virtual const char* mi::neuraylib::IFunction_call::get_parameter_name ( Size  index) const
pure virtual

Returns the name of the parameter at index.

Parameters
indexThe index of the parameter.
Returns
The name of the parameter, or NULL if index is out of range.
virtual const IType_list* mi::neuraylib::IFunction_call::get_parameter_types ( ) const
pure virtual

Returns the types of all parameters.

virtual const IType* mi::neuraylib::IFunction_call::get_return_type ( ) const
pure virtual

Returns the return type of the corresponding function definition.

bool mi::neuraylib::IFunction_call::is_array_constructor ( ) const
inline

Indicates whether this call is and instance of the array constructor.

See Also
Arrays
virtual Sint32 mi::neuraylib::IFunction_call::set_argument ( Size  index,
const IExpression argument 
)
pure virtual

Sets the argument at index.

Parameters
indexThe index of the argument.
argumentThe argument. Note that the expression is copied. This copy operation is a shallow copy, e.g., DB elements referenced in call expressions are not copied.
Returns
  • 0: Success.
  • -1: Invalid parameters (NULL pointer).
  • -2: Parameter index does not exist.
  • -3: The argument type does not match the parameter type.
  • -4: The function call is immutable (because it appears in a default of a function or material definition).
  • -5: The parameter type is uniform, but the argument type is varying.
  • -6: The argument expression is not a constant nor a call.
  • -7: The argument contains references to DB elements in a scope that is more private scope than the scope of this material instance.
  • -8: The parameter types is uniform, but the argument is a call expression and the return type of the called function definition is effectively varying since the function definition itself is varying.
virtual Sint32 mi::neuraylib::IFunction_call::set_argument ( const char *  name,
const IExpression argument 
)
pure virtual

Sets an argument identified by name.

Parameters
nameThe name of the parameter.
argumentThe argument. Note that the expression is copied. This copy operation is a shallow copy, e.g., DB elements referenced in call expressions are not copied.
Returns
  • 0: Success.
  • -1: Invalid parameters (NULL pointer).
  • -2: Parameter name does not exist.
  • -3: The argument type does not match the parameter type.
  • -4: The function call is immutable (because it appears in a default of a function or material definition).
  • -5: The parameter type is uniform, but the argument type is varying.
  • -6: The argument expression is not a constant nor a call.
  • -7: The argument contains references to DB elements in a scope that is more private scope than the scope of this material instance.
  • -8: The parameter types is uniform, but the argument is a call expression and the return type of the called function definition is effectively varying since the function definition itself is varying.
virtual Sint32 mi::neuraylib::IFunction_call::set_arguments ( const IExpression_list arguments)
pure virtual

Sets multiple arguments.

Parameters
argumentsThe arguments. Note that the expressions are copied. This copy operation is a shallow copy, e.g., DB elements referenced in call expressions are not copied.
Returns
  • 0: Success.
  • -1: Invalid parameters (NULL pointer).
  • -2: One of the parameters in arguments does not exist.
  • -3: One of the argument types does not match the corresponding parameter type.
  • -4: The function call is immutable (because it appears in a default of a function or material definition).
  • -5: One of the parameter types is uniform, but the corresponding argument type is varying.
  • -6: One of the arguments is not a constant nor a call.
  • -7: One of the arguments contains references to DB elements in a scope that is more private scope than the scope of this material instance.
  • -8: One of the parameter types is uniform, but the corresponding argument is a call expression and the return type of the called function definition is effectively varying since the function definition itself is varying.