MDL SDK API nvidia_logo_transpbg.gif Up
iscope.h
Go to the documentation of this file.
1/***************************************************************************************************
2 * Copyright 2024 NVIDIA Corporation. All rights reserved.
3 **************************************************************************************************/
6
7#ifndef MI_NEURAYLIB_ISCOPE_H
8#define MI_NEURAYLIB_ISCOPE_H
9
11
13
14namespace mi {
15
16namespace neuraylib {
17
42class IScope : public
43 mi::base::Interface_declare<0x578df0c5,0xab97,0x460a,0xb5,0x0a,0x2c,0xf8,0x54,0x22,0x31,0xb9>
44{
45public:
55
66 template<class T>
68 {
69 ITransaction* ptr_itransaction = create_transaction();
70 if ( !ptr_itransaction)
71 return 0;
72 T* ptr_T = static_cast<T*>( ptr_itransaction->get_interface( typename T::IID()));
73 ptr_itransaction->release();
74 return ptr_T;
75 }
76
82 virtual const char* get_id() const = 0;
83
91 virtual Uint8 get_privacy_level() const = 0;
92
96 virtual const char* get_name() const = 0;
97
101 virtual IScope* get_parent() const = 0;
102};
103 // end group mi_neuray_database_access
105
106} // namespace neuraylib
107
108} // namespace mi
109
110#endif // MI_NEURAYLIB_ISCOPE_H
Mixin class template for deriving new interface declarations.
Definition: interface_declare.h:43
A scope is the context which determines the visibility of database elements.
Definition: iscope.h:44
virtual const char * get_id() const =0
Returns the ID of the scope.
virtual ITransaction * create_transaction()=0
Creates a new transaction associated with this scope.
virtual const char * get_name() const =0
Returns the name of the scope.
virtual IScope * get_parent() const =0
Returns the parent scope.
T * create_transaction()
Creates a new transaction associated with this scope.
Definition: iscope.h:67
virtual Uint8 get_privacy_level() const =0
Returns the privacy level of the scope.
A transaction provides a consistent view on the database.
Definition: itransaction.h:82
virtual const IInterface * get_interface(const Uuid &interface_id) const =0
Acquires a const interface from another.
virtual Uint32 release() const =0
Decrements the reference count.
unsigned char Uint8
8-bit unsigned integer.
Definition: types.h:47
Mixin class template for deriving new interface declarations.
Database transactions.
Common namespace for APIs of NVIDIA Advanced Rendering Center GmbH.
Definition: example_derivatives.dox:5