NVIDIA Iray: Math API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Interface Framework Technology

The classes provided here support conventional modern C++ library design principles for component software to achieve binary compatibility across shared library boundaries and future extensibility. More...

Classes

class   mi::base::Handle< Interface >
  Handle class template for interfaces, automatizing the lifetime control via reference counting. More...
 
class   mi::base::IInterface
  The basic extensible interface. More...
 
class   mi::base::Interface_declare< id1, id2, id3, id4, id5, id6, id7, id8, id9, id10, id11, I >
  Mixin class template for deriving new interface declarations. More...
 
class   mi::base::Interface_implement< I >
  Mixin class template for deriving interface implementations. More...
 
class   mi::base::Interface_implement_2< I1, I2 >
  Mixin class template for deriving interface implementations from two interfaces. More...
 
class   mi::base::Interface_implement_singleton< I >
  Mixin class template for deriving singleton interface implementations, where the reference count is fixed to one. More...
 
class   mi::base::Interface_merger< MAJOR, MINOR >
  This mixin merges the implementation of one interface with a second interface. More...
 
struct   mi::base::Uuid
  A 128 bit representation of a universally unique identifier (UUID or GUID). More...
 
class   mi::base::Uuid_t< id1, id2, id3, id4, id5, id6, id7, id8, id9, id10, id11 >
  Class template for a compile-time representation of universally unique identifiers (UUIDs or GUIDs). More...
 

Typedefs

typedef const
Dup_interface_helper * 
mi::base::Dup_interface
  Type for a symbolic constant to trigger a special constructor in the Handle class. More...
 

Functions

template<class Interface1 , class Interface2 >
bool  mi::base::operator== (const Handle< Interface1 > &lhs, const Handle< Interface2 > &rhs)
  Returns true if the underlying interface pointers are equal. More...
 
template<class Interface1 , class Interface2 >
bool  mi::base::operator!= (const Handle< Interface1 > &lhs, const Handle< Interface2 > &rhs)
  Returns true if the underlying interface pointers are not equal. More...
 
template<class Interface >
Handle< Interface >  mi::base::make_handle (Interface *iptr)
  Returns a handle that holds the interface pointer passed in as argument. More...
 
template<class Interface >
Handle< Interface >  mi::base::make_handle_dup (Interface *iptr)
  Converts passed-in interface pointer to a handle, without taking interface over. More...
 
bool  mi::base::operator== (const Uuid &id1, const Uuid &id2)
  Returns true if id1 is equal to id2. More...
 
bool  mi::base::operator!= (const Uuid &id1, const Uuid &id2)
  Returns true if id1 is not equal to id2. More...
 
bool  mi::base::operator< (const Uuid &id1, const Uuid &id2)
  Returns true if id1 is less than id2. More...
 
bool  mi::base::operator> (const Uuid &id1, const Uuid &id2)
  Returns true if id1 is greater than id2. More...
 
bool  mi::base::operator<= (const Uuid &id1, const Uuid &id2)
  Returns true if id1 is less than or equal to id2. More...
 
bool  mi::base::operator>= (const Uuid &id1, const Uuid &id2)
  Returns true if id1 is greater than or equal to id2. More...
 
Uint32  mi::base::uuid_hash32 (const Uuid &id)
  Returns a 32 bit hash value by performing a bitwise xor of all four 32 bit values. More...
 
const IInterface *  mi::base::Interface_merger< MAJOR, MINOR >::get_interface (const Uuid &interface_id) const
  Reimplements mi::base::IInterface::get_interface(const Uuid&) const. More...
 
IInterface *  mi::base::Interface_merger< MAJOR, MINOR >::get_interface (const Uuid &interface_id)
  Reimplements mi::base::IInterface::get_interface(const Uuid&). More...
 

Variables

static const Dup_interface  mi::base::DUP_INTERFACE = 0
  Symbolic constant to trigger a special constructor in the Handle class. More...
 

Detailed Description

The classes provided here support conventional modern C++ library design principles for component software to achieve binary compatibility across shared library boundaries and future extensibility.

The design provides access through interfaces, which are abstract base classes with pure virtual member functions.

Interfaces derived from mi::base::IInterface refer to reference-counted dynamic resources that need to be released. To avoid manual reference counting, you can use the provided handle class mi::base::Handle, which is a smart-pointer implementation with automatic reference counting. You can also use other handle class implementations, e.g., std::tr1::shared_ptr<T> (or boost::shared_ptr<T>).

Typedef Documentation

typedef const Dup_interface_helper* mi::base::Dup_interface

Type for a symbolic constant to trigger a special constructor in the Handle class.

See Also
mi::base::Handle::Handle(Interface* ptr,Dup_interface)

Function Documentation

template<typename MAJOR , typename MINOR >
const IInterface * mi::base::Interface_merger< MAJOR, MINOR >::get_interface ( const Uuid interface_id) const

Reimplements mi::base::IInterface::get_interface(const Uuid&) const.

Forwards the call to the MAJOR base class, and then, in case of failure, to the MINOR base class.

template<typename MAJOR , typename MINOR >
IInterface * mi::base::Interface_merger< MAJOR, MINOR >::get_interface ( const Uuid interface_id)

Reimplements mi::base::IInterface::get_interface(const Uuid&).

Forwards the call to the MAJOR base class, and then, in case of failure, to the MINOR base class.

template<class Interface >
Handle<Interface> mi::base::make_handle ( Interface *  iptr)
inline

Returns a handle that holds the interface pointer passed in as argument.

This helper function template simplifies the creation of handles with an interface type that matches the type of the interface argument. In contrast to make_handle_dup(), the handle takes ownership of the interface.

template<class Interface >
Handle<Interface> mi::base::make_handle_dup ( Interface *  iptr)
inline

Converts passed-in interface pointer to a handle, without taking interface over.

This helper function template simplifies the creation of handles with an interface type that matches the type of the interface argument. In contrast to make_handle(), the handle does not take ownership of the interface.

bool mi::base::operator!= ( const Uuid &  id1,
const Uuid &  id2 
)
inline

Returns true if id1 is not equal to id2.

template<class Interface1 , class Interface2 >
bool mi::base::operator!= ( const Handle< Interface1 > &  lhs,
const Handle< Interface2 > &  rhs 
)
inline

Returns true if the underlying interface pointers are not equal.

bool mi::base::operator< ( const Uuid &  id1,
const Uuid &  id2 
)
inline

Returns true if id1 is less than id2.

bool mi::base::operator<= ( const Uuid &  id1,
const Uuid &  id2 
)
inline

Returns true if id1 is less than or equal to id2.

bool mi::base::operator== ( const Uuid &  id1,
const Uuid &  id2 
)
inline

Returns true if id1 is equal to id2.

template<class Interface1 , class Interface2 >
bool mi::base::operator== ( const Handle< Interface1 > &  lhs,
const Handle< Interface2 > &  rhs 
)
inline

Returns true if the underlying interface pointers are equal.

bool mi::base::operator> ( const Uuid &  id1,
const Uuid &  id2 
)
inline

Returns true if id1 is greater than id2.

bool mi::base::operator>= ( const Uuid &  id1,
const Uuid &  id2 
)
inline

Returns true if id1 is greater than or equal to id2.

Uint32 mi::base::uuid_hash32 ( const Uuid &  id)
inline

Returns a 32 bit hash value by performing a bitwise xor of all four 32 bit values.

Variable Documentation

const Dup_interface mi::base::DUP_INTERFACE = 0
static

Symbolic constant to trigger a special constructor in the Handle class.

See Also
mi::base::Handle::Handle(Interface* ptr,Dup_interface)