neuray API Programmer's Manual

mi::ICall_decl Class Reference

[Types]

Description

A call declaration is used to describe call types. It contains all the type information required for call types: the number of arguments, their names and types. In contrast to elements of a map call arguments are ordered and do not need to be of the same type.

Call declarations can be used to register new call types. In this case, they are populated through a sequence of add_argument() calls. Finally, such a declaration is registered via mi::neuraylib::IExtension_api::register_call_decl(). The name used for registration can later be used as a type name to create instances of the type described by the declaration.

See also:

mi::ICall, mi::IMap

Public Member Functions

virtual Sint32 add_argument( const char* type_name, const char* name) =0
Adds a new argument to the call declaration. More...
virtual const char* get_argument_name( Size index) const =0
Returns the argument name of a certain call argument. More...
virtual const char* get_argument_type_name( Size index) const =0
Returns the type name of a certain call argument. More...
virtual const char* get_argument_type_name( const char* name) const =0
Returns the type name of a certain call argument. More...
virtual const char* get_call_type_name() const =0
Returns the type name used to register this call declaration. More...
virtual Size get_length() const =0
Returns the number of call arguments.
virtual Sint32 remove_argument( const char* name) =0
Removes an argument from the call declaration. More...

Member Functions

virtual Sint32 mi::​ICall_decl::add_argument( const char* type_name, const char* name) [pure virtual]

Adds a new argument to the call declaration.

Parameters

type_name
The type name of the new argument, see Types for valid type names. Note that this method does not check the type name for validity (since validity at the time of this method call does not imply validity at the time of instantiation).
name
The name of the new argument.

Returns

  • 0: Success.
  • -1: Invalid parameters (NULL pointer).
  • -2: There is already an argument with name name.
virtual const char* mi::​ICall_decl::get_argument_name( Size index) const [pure virtual]

Returns the argument name of a certain call argument.

Parameters

index
The index of the requested call argument.

Returns

The argument name of that call argument, or NULL if index is out of bounds.

virtual const char* mi::​ICall_decl::get_argument_type_name( Size index) const [pure virtual]

Returns the type name of a certain call argument.

Parameters

index
The index of the requested call argument.

Returns

The type name of that call argument, or NULL if index is out of bounds.

virtual const char* mi::​ICall_decl::get_argument_type_name( const char* name) const [pure virtual]

Returns the type name of a certain call argument.

Parameters

name
The name of the requested call argument.

Returns

The type name of that call argument, or NULL if there is no call argument with name name .

virtual const char* mi::​ICall_decl::get_call_type_name() const [pure virtual]

Returns the type name used to register this call declaration. Note that the type name will only be available after registration, i.e., if the declaration has been obtained from mi::ICall::get_call_decl() or mi::neuraylib::IFactory::get_call_decl().

The 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 the methods on this interface to obtain information about the type itself.

Returns

The type name under which this call declaration was registered, or NULL in case of failure.

virtual Size mi::​ICall_decl::get_length() const [pure virtual]

Returns the number of call arguments.

virtual Sint32 mi::​ICall_decl::remove_argument( const char* name) [pure virtual]

Removes an argument from the call declaration.

Parameters

name
The name of the argument to remove.

Returns

  • 0: Success.
  • -1: Invalid parameters (NULL pointer).
  • -2: There is no argument with name name.