neuray Services API Programmer's Manual

mi::nservices::IArgument_description Class Reference

[Commands]

Description

Describes an argument to a service command. Used by the framework to validate arguments before execution of a command.

Public Member Functions

virtual const IDataget_default_value() const =0
Gets the default value of the argument. More...
virtual const char* get_description() const =0
Get the description of the argument. More...
virtual const char* get_name() const =0
Get the name of the argument. More...
virtual const char* get_type_name() const =0
Get the type name of the argument. More...
virtual bool  has_default_value() const =0
Returns whether a default value has been set for this argument. More...
virtual mi::Sint32 set_default_value( const IData* value) =0
Sets the default value of the argument. More...
virtual void set_description( const char* description) =0
Set the description of the argument. More...
virtual void set_name( const char* name) =0
Set the name of the argument. More...
virtual void set_type_name( const char* type_name) =0
Set the type name of the argument. More...

Member Functions

virtual const IData* mi::​nservices::​IArgument_description::get_default_value() const [pure virtual]

Gets the default value of the argument.

Returns

the default value

virtual const char* mi::​nservices::​IArgument_description::get_description() const [pure virtual]

Get the description of the argument.

Returns

NULL if description is empty.

virtual const char* mi::​nservices::​IArgument_description::get_name() const [pure virtual]

Get the name of the argument.

Returns

NULL if the name is empty.

virtual const char* mi::​nservices::​IArgument_description::get_type_name() const [pure virtual]

Get the type name of the argument.

Returns

NULL if type name is empty.

virtual bool mi::​nservices::​IArgument_description::has_default_value() const [pure virtual]

Returns whether a default value has been set for this argument. Arguments with a default value are optional and will automatically be provided with the default value if not supplied. Arguments without a default value are mandatory and neuray services will return an error and not call the command if the argument is not supplied.

Returns

true if a default value has been set, false otherwise

virtual mi::Sint32 mi::​nservices::​IArgument_description::set_default_value( const IData* value) [pure virtual]

Sets the default value of the argument. Calling this will make the argument optional. If set_type_name has been called and value is not compatible with the specified type then an error will be returned and the default value will not be registered.

Parameters

value
the default value, can be NULL

Returns

  • NRS_ERROR_NONE success, value will be used as the default.
  • NRS_ERROR_INVALID_PARAMETERS value cannot be used as a default.
virtual void mi::​nservices::​IArgument_description::set_description( const char* description) [pure virtual]

Set the description of the argument.

Parameters

description
the description of the argument
virtual void mi::​nservices::​IArgument_description::set_name( const char* name) [pure virtual]

Set the name of the argument.

Parameters

name
the name of the argument
virtual void mi::​nservices::​IArgument_description::set_type_name( const char* type_name) [pure virtual]

Set the type name of the argument. See Types for valid data types.

Parameters

type_name
the type name of the argument