neuray API Programmer's Manual

mi::ICall Class Reference

[Collections]

Description

This interface represents calls. Calls appear in the fields and temporaries of the MDL interface mi::neuraylib::IMdl_compiled_material. They represent calls of instances of mi::neuraylib::IMdl_function_definition.

Calls are very similar to structures: the arguments of a call are equivalent to the members of a structure. In addition to structures, calls have one additional data item: the name of the called function definition.

Calls are based on a call declaration which defines the call arguments (their types, name, and the order). The type name of a call is the name that was used to register its call declaration. This type name can be used to create instances of a particular call declaration (note that "Call" itself is not a valid type name as it does not contain any information about a concrete call type).

This interface does not offer any specialized methods, except get_call_decl(), set_function_definition(), and get_function_definition(). Most of the call functionality is available via methods inherited from mi::IData_collection where the name of a call argument equals the key. The key indices correspond with the indices in the call declaration.

Note:

The value returned by mi::IData::get_type_name() might start with '(' which indicates that it has been automatically generated. In this case the type name should be treated as an opaque string since its format might change unexpectedly. It is perfectly fine to pass it to other methods, e.g., mi::neuraylib::IFactory::create(), but you should not attempt to interpret the value in any way. Use get_call_decl() to obtain information about the type itself.

See also:

mi::ICall_decl

Public Member Functions

virtual const ICall_declget_call_decl() const =0
Returns the call declaration for this call.
virtual const char* get_function_definition() const =0
Returns the DB name of the represented function definition.
virtual Sint32 set_function_definition( const char* name) =0
Sets the represented function definition. More...

Member Functions

virtual const ICall_decl* mi::​ICall::get_call_decl() const [pure virtual]

Returns the call declaration for this call.

virtual const char* mi::​ICall::get_function_definition() const [pure virtual]

Returns the DB name of the represented function definition.

virtual Sint32 mi::​ICall::set_function_definition( const char* name) [pure virtual]

Sets the represented function definition. Note that a NULL pointer is a valid parameter value that clears the previously set function. Subsequent get_function_definition() calls will return NULL then.

Parameters

name
The DB name of the represented function definition.

Returns

  • 0: Success.
  • -2: There is no element with that name.
  • -4: The call can not be set to the function definition because the function definition is in a more private scope than the call.