ipointer.h File Reference
Description
Pointer type.
Code Example
ipointer.h
/***************************************************************************************************
* Copyright 2024 NVIDIA Corporation. All rights reserved.
**************************************************************************************************/
#ifndef MI_NEURAYLIB_IPOINTER_H
#define MI_NEURAYLIB_IPOINTER_H
#include <mi/neuraylib/idata.h>
namespace mi {
class IPointer :
public base::Interface_declare<0xd921b94b,0x0b64,0x4da0,0x97,0x95,0xdc,0x4d,0xaf,0x99,0x95,0xd5,
IData_simple>
{
public:
virtual Sint32
set_pointer( base::IInterface* pointer) = 0;
virtual base::IInterface* get_pointer() const = 0;
template<class T>
T* get_pointer() const
{
base::IInterface* ptr_iinterface = get_pointer();
if ( !ptr_iinterface)
return 0;
T* ptr_T = static_cast<T*>( ptr_iinterface->get_interface( typename T::IID()));
ptr_iinterface->release();
return ptr_T;
}
};
class IConst_pointer :
public base::Interface_declare<0x67bfc3ef,0x7d18,0x406e,0x95,0x3b,0x98,0xe6,0xb2,0x98,0x93,0x39,
IData_simple>
{
public:
virtual Sint32
set_pointer( const base::IInterface* pointer) = 0;
virtual const base::IInterface* get_pointer() const = 0;
template<class T>
const T* get_pointer() const
{
const base::IInterface* ptr_iinterface = get_pointer();
if ( !ptr_iinterface)
return 0;
const T* ptr_T = static_cast<const T*>( ptr_iinterface->get_interface( typename T::IID()));
ptr_iinterface->release();
return ptr_T;
}
};
// end group mi_neuray_simple_types
} // namespace mi
#endif // MI_NEURAYLIB_IPOINTER_H
Namespaces
- namespace
- Common namespace for APIs of NVIDIA Advanced Rendering Center GmbH. More...