RealityServer Web Services API Programmer's Manual

mi::rswservices::IProtocol_context Class Reference

[Protocol Processing]

Description

Context class used by protocol modules.

Public Member Functions

virtual IMapget_attachments() const =0
retrieves the global attachment object. More...
virtual const nservices::IService_commandget_command( const char* command_name, const char* command_set) const =0
Retrieves a registered service command. More...
virtual const nservices::IService_commandget_command( Size idx, const char* command_set) const =0
Allows for iteration over all registered commands. More...
virtual IDynamic_arrayget_command_array() =0
returns an array which the user should add ICommand_request objects to. More...
virtual const char* get_command_set( Size idx) const =0
Allows for iteration over all registered command sets. More...
virtual mi::nservices::IConverterget_converter() const =0
Returns the type converter used. More...
virtual nservices::IEvent_contextget_event_context() =0
get the event context associated with this service request More...
virtual nservices::IFactoryget_factory() =0
retrieves a factory More...
virtual const nservices::IUser_type_definitionget_user_type( const char* type_name) const =0
Gets the description of a registered user type. More...
virtual const nservices::IUser_type_definitionget_user_type( Size idx) const =0
Allows for iteration over all registered user types. More...
virtual mi::Sint32 set_converter( mi::nservices::IConverter* converter) =0
Specifies a converter implementation to use for this protocols command arguments. More...

Member Functions

virtual IMap* mi::​rswservices::​IProtocol_context::get_attachments() const [pure virtual]

retrieves the global attachment object. These attachments will be provided to all context objects.

Returns

an object with which to manipulate attachments

virtual const nservices::IService_command* mi::​rswservices::​IProtocol_context::get_command( const char* command_name, const char* command_set) const [pure virtual]

Retrieves a registered service command.

Parameters

command_name
the name of the command.
command_set
the command set in which to look for the command.

Returns

the found command or NULL if command_name or command_set don't exist or the framework is not initialized

virtual const nservices::IService_command* mi::​rswservices::​IProtocol_context::get_command( Size idx, const char* command_set) const [pure virtual]

Allows for iteration over all registered commands.

Parameters

idx
the index of the command
command_set
the command set in which to look for the command.

Returns

the found command or NULL if idx is too large.

virtual IDynamic_array* mi::​rswservices::​IProtocol_context::get_command_array() [pure virtual]

returns an array which the user should add ICommand_request objects to. Each command will be executed in the order they appear in the array

Returns

the array.

virtual const char* mi::​rswservices::​IProtocol_context::get_command_set( Size idx) const [pure virtual]

Allows for iteration over all registered command sets.

Parameters

idx
the index of the command set

Returns

the command set name or NULL if idx is too large.

virtual mi::nservices::IConverter* mi::​rswservices::​IProtocol_context::get_converter() const [pure virtual]

Returns the type converter used. This will be the default neuray services one unless set_converter has been called.

Returns

the type converter

virtual nservices::IEvent_context* mi::​rswservices::​IProtocol_context::get_event_context() [pure virtual]

get the event context associated with this service request

Returns

the event context

virtual nservices::IFactory* mi::​rswservices::​IProtocol_context::get_factory() [pure virtual]

retrieves a factory

Returns

the factory or NULL if neuray services is not initialized.

virtual const nservices::IUser_type_definition* mi::​rswservices::​IProtocol_context::get_user_type( const char* type_name) const [pure virtual]

Gets the description of a registered user type.

Parameters

type_name
the name of the type.

Returns

the user type or NULL if not found.

virtual const nservices::IUser_type_definition* mi::​rswservices::​IProtocol_context::get_user_type( Size idx) const [pure virtual]

Allows for iteration over all registered user types.

Parameters

idx
the index of the user type.

Returns

the user type or NULL if idx is too large.

virtual mi::Sint32 mi::​rswservices::​IProtocol_context::set_converter( mi::nservices::IConverter* converter) [pure virtual]

Specifies a converter implementation to use for this protocols command arguments. The supplied converter will override the default one used by neuray services. A protocol would typically supply it's own converter if it's string representation of types is not supported by the default. A converter should be set during the deserialization phase and it will be made available to the neuray services core and during the serialization phase.

Note:

a converter can only be set during the deserialize phase of protocol processing. If set_converter is called during serialization the call will fail.

Parameters

converter
the converter to use.

Returns

  • NRS_ERROR_NONE : success.
  • NRS_ERROR_INVALID_PARAMETERS : converter is NULL
  • NRS_ERROR_FAILED : general failure.