neuray Services API Programmer's Manual

mi::nservices::IService_command Class Reference

[Commands]

Description

Interface for Neuray Service Commands. All service command implementations are derived from this interface. Commands are registered using IServices_extension_context during plugin initialization.

Public Member Functions

virtual const ICommand_responseexecute( ICommand_context* context) const =0
Executes the command itself. More...
virtual Sint32 get_argument_description( IFactory* factory, const char* argument_name, IArgument_description* argument) const =0
Get the description for a particular argument. More...
virtual Sint32 get_argument_description( IFactory* factory, Uint32 index, IArgument_description* argument) const =0
Get the description for a particular argument by index. More...
virtual const char* get_description() const =0
Returns the command description. More...
virtual const char* get_metadata( const char* key) const =0
Gets the commands metadata associated with key. More...
virtual const char* get_metadata_key( mi::Uint32 index) const =0
Gets the commands metadata keys by index. More...
virtual const char* get_metadata_value( mi::Uint32 index) const =0
Gets the commands metadata values by index. More...
virtual const char* get_name() const =0
The name of the command. More...
virtual const char* get_namespace() const =0
Returns the namespace in which the command exists. More...
virtual const char* get_return_description() const =0
Returns a description of the commands return data.
virtual const char* get_return_type_name() const =0
Returns the type name of the commands return value. More...

Member Functions

virtual const ICommand_response* mi::​nservices::​IService_command::execute( ICommand_context* context) const [pure virtual]

Executes the command itself. This method should consult context to find it's arguments and obtain access to the neuray library to execute it's functionality. A response is created with ICommand_context::create_command_response(), filled out and returned. returns NULL then a response will be created for it and it's result set to NULL.

Parameters

context
the context in which to execute the command

Returns

the response of the command

virtual Sint32 mi::​nservices::​IService_command::get_argument_description( IFactory* factory, const char* argument_name, IArgument_description* argument) const [pure virtual]

Get the description for a particular argument.

Parameters

factory
a factory which can be used to create default values
argument_name
the name of the argument whose description should be fetched
argument
the argument description to fill out

Returns

  • NRS_ERROR_NONE success, argument contains a description of argument_name.
  • NRS_ERROR_NOT_FOUND argument_name is not a supported argument.
  • NRS_ERROR_FAILED general error

virtual Sint32 mi::​nservices::​IService_command::get_argument_description( IFactory* factory, Uint32 index, IArgument_description* argument) const [pure virtual]

Get the description for a particular argument by index. The command should fill out the argument parameter describing each argument that the command accepts. The method should return NRS_ERROR_NONE if there are more arguments to describe and NRS_ERROR_NOT_FOUND if it is the last argument.

Parameters

factory
a factory which can be used to create default values
index
argument index
argument
the argument description to fill out

Returns

  • NRS_ERROR_NONE success, argument contains a description of argument index.
  • NRS_ERROR_NOT_FOUND index is greater than the number of supported arguments.
  • NRS_ERROR_FAILED general error

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

Returns the command description.

Returns

description

virtual const char* mi::​nservices::​IService_command::get_metadata( const char* key) const [pure virtual]

Gets the commands metadata associated with key.

Parameters

key
The name of the key whose metadata should be returned.

Returns

The metadata associated with key or NULL on error.

virtual const char* mi::​nservices::​IService_command::get_metadata_key( mi::Uint32 index) const [pure virtual]

Gets the commands metadata keys by index. Allows iteration over metadata keys. The method should return NULL when index is equal to the number of metadata entries.

Parameters

index
The metadata index.

Returns

The metadata key at index or null if no metadata exists for index .

virtual const char* mi::​nservices::​IService_command::get_metadata_value( mi::Uint32 index) const [pure virtual]

Gets the commands metadata values by index. Allows iteration over metadata values. The method should return NULL when index is equal to the number of metadata entries.

Parameters

index
The metadata index.

Returns

The metadata value at index or null if no metadata exists for index .

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

The name of the command.

Returns

the command name

virtual const char* mi::​nservices::​IService_command::get_namespace() const [pure virtual]

Returns the namespace in which the command exists. Return NULL for the global namespace. Namespaces consist of a :: separated sequence of strings.

Returns

the namespace

virtual const char* mi::​nservices::​IService_command::get_return_description() const [pure virtual]

Returns a description of the commands return data.

virtual const char* mi::​nservices::​IService_command::get_return_type_name() const [pure virtual]

Returns the type name of the commands return value.

See also:

Types.

Returns

the type name returned by the command