A scope is the context which determines the visibility of database elements. More...
#include <iscope.h>
Public Member Functions | |
virtual ITransaction * | create_transaction ()=0 |
Creates a new transaction associated with this scope. More... | |
template<class T> | |
T * | create_transaction () |
Creates a new transaction associated with this scope. More... | |
virtual const char * | get_id () const =0 |
Returns the ID of the scope. More... | |
virtual Uint8 | get_privacy_level () const =0 |
Returns the privacy level of the scope. More... | |
virtual const char * | get_name () const =0 |
Returns the name of the scope. More... | |
virtual IScope * | get_parent () const =0 |
Returns the parent scope. More... | |
Public Member Functions inherited from mi::base::IInterface | |
virtual Uint32 | retain () const =0 |
Increments the reference count. More... | |
virtual Uint32 | release () const =0 |
Decrements the reference count. More... | |
virtual const IInterface * | get_interface (const Uuid &interface_id) const =0 |
Acquires a const interface from another. More... | |
template<class T> | |
const T * | get_interface () const |
Acquires a const interface from another. More... | |
virtual IInterface * | get_interface (const Uuid &interface_id)=0 |
Acquires a mutable interface from another. More... | |
template<class T> | |
T * | get_interface () |
Acquires a mutable interface from another. More... | |
virtual Uuid | get_iid () const =0 |
Returns the interface ID of the most derived interface. More... | |
Additional Inherited Members | |
Public Types inherited from mi::base::Interface_declare< 0x578df0c5, ... > | |
typedef Interface_declare< id1, ... > | Self |
Own type. More... | |
typedef Uuid_t< id1, ... > | IID |
Declares the interface ID (IID) of this interface. More... | |
Public Types inherited from mi::base::IInterface | |
typedef Uuid_t<0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0> | IID |
Declares the interface ID (IID) of this interface. More... | |
Static Public Member Functions inherited from mi::base::Interface_declare< 0x578df0c5, ... > | |
static bool | compare_iid (const Uuid &iid) |
Compares the interface ID iid against the interface ID of this interface and of its ancestors. More... | |
Static Public Member Functions inherited from mi::base::IInterface | |
static bool | compare_iid (const Uuid &iid) |
Compares the interface ID iid against the interface ID of this interface. More... | |
A scope is the context which determines the visibility of database elements.
Scopes are organized in a tree-like fashion and have a so-called privacy level. The root of the tree is called global scope and has privacy level 0. On each path from the global scope to one of the leafs of the tree the privacy levels are strictly increasing. Scopes are identified with a cluster-unique ID which can be used to access a scope on any host in the cluster.
A database element stored in a given scope is only visible in this scope and all child scopes. For example, a database element stored in the global scope is visible in all scopes. This visibility concept for database elements is similar to visibility of stack variables in programming languages.
Any database element can exist in multiple versions (at most one version per scope). In this case the scope at hand does not just determine the visibility itself but also determines which version is visible. The version from the current scope has highest priority, next is the version from the parent scope, etc., until the global scope is reached. Again, this is similar to shadowing of variables with the same name in programming languages.
For scope management see the methods on mi::neuraylib::IDatabase.
|
inline |
Creates a new transaction associated with this scope.
This templated member function is a wrapper of the non-template variant for the user's convenience. It eliminates the need to call mi::base::IInterface::get_interface(const Uuid&) on the returned pointer, since the return type already is a pointer to the type T
specified as template parameter.
T | The interface type of the transaction to create. |
|
pure virtual |
Creates a new transaction associated with this scope.
DiCE users should treat ITransaction
as an opaque type. Instead, you should use mi::neuraylib::IDice_transaction which is better suited for the needs of DiCE. To create such a DiCE transaction call the templated variant mi::neuraylib::IScope::create_transaction<mi::neuraylib::IDice_transaction>().
|
pure virtual |
Returns the ID of the scope.
Can be used to retrieve the scope from the database later.
|
pure virtual |
Returns the name of the scope.
NULL
if the scope has no name.
|
pure virtual |
Returns the parent scope.
NULL
if the scope is the global scope.
|
pure virtual |
Returns the privacy level of the scope.
The global scope has privacy level 0, all other scopes have higher privacy levels. On each path from the global scope to any other scope in the scope tree the privacy levels are strictly increasing.