RealityServer Web Services API Programmer's Manual

mi::rswservices::IState_context Class Reference

[State Processing]

Description

Context class used by state modules.

Public Member Functions

virtual bool  create_user_state( const char* name, Uint32 timeout) =0
Creates a user state by name. More...
virtual bool  delete_user_state( const char* name) =0
deletes the user state More...
virtual IMapget_attachments() const =0
retrieves the global attachment object. More...
virtual nservices::IEvent_contextget_event_context() const =0
retrieves the event context. More...
virtual nservices::IFactoryget_factory() const =0
retrieves a factory More...
virtual neuraylib::IPlugin_apiget_plugin_api() const =0
Get the IPlugin_api. More...
virtual neuraylib::ITransactionget_user_state_transaction() =0
Retrieves a transaction into the user state. More...
virtual bool  set_execution_scope_name( const char* scope_name) =0
Sets the name of the scope to use when executing commands. More...
virtual bool  set_user_state_name( const char* state_name) =0
Sets the name of the state to use to store user state information. More...

Member Functions

virtual bool mi::​rswservices::​IState_context::create_user_state( const char* name, Uint32 timeout) [pure virtual]

Creates a user state by name. This state will persist between separate service calls and may be used to store user state information. Note that the created state does not become the current user state. Call set_user_state_name to use the new scope. If a timeout is specified then the deletion timer begins running immediately.

Parameters

name
the name of the state
timeout
if > 0 then the state is deleted this many seconds after its last usage

Returns

true if creation succeeded, false otherwise

virtual bool mi::​rswservices::​IState_context::delete_user_state( const char* name) [pure virtual]

deletes the user state

Parameters

name
the name of the state

Returns

true if deletion succeeded, false otherwise

virtual IMap* mi::​rswservices::​IState_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 nservices::IEvent_context* mi::​rswservices::​IState_context::get_event_context() const [pure virtual]

retrieves the event context. This context can be used to register any events the user state wishes to listen for.

Returns

the event context

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

retrieves a factory

Returns

the factory or NULL if neuray services is not initialized.

virtual neuraylib::IPlugin_api* mi::​rswservices::​IState_context::get_plugin_api() const [pure virtual]

Get the IPlugin_api.

Returns

the plugin api

virtual neuraylib::ITransaction* mi::​rswservices::​IState_context::get_user_state_transaction() [pure virtual]

Retrieves a transaction into the user state. If no user state has been set with set_user_scope_name then this returns NULL.

Returns

the transaction or NULL if user state is not set.

virtual bool mi::​rswservices::​IState_context::set_execution_scope_name( const char* scope_name) [pure virtual]

Sets the name of the scope to use when executing commands. All service commands will be executed within this scope unless a service command explicitly changes scope. If this method is not called, or if the call fails, then the global scope is used by all commands.

Parameters

scope_name
the name of the scope

Returns

true if the scope exists, false otherwise

virtual bool mi::​rswservices::​IState_context::set_user_state_name( const char* state_name) [pure virtual]

Sets the name of the state to use to store user state information. This state must already have been created with create_user_state. A transaction into this state can be retrieved with get_user_state_transaction. This transaction will be passed into all service commands and event handlers. It will also be used for RealityServer management purposes. Core commands will not use the user state in any way. If set_user_state_name is not called then no user state transaction is available and RealityServer uses a default state for management.

Parameters

state_name
the name of the state

Returns

true on success, false if state does not exist