neuray API Programmer's Manual

Interface Framework Technology

[Base API]

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>).

Classes

class 
Handle class template for interfaces, automatizing the lifetime control via reference counting. More...
class 
The basic extensible interface. More...
class 
Mixin class template for deriving new interface declarations. More...
class 
Mixin class template for deriving interface implementations. More...
class 
Mixin class template for deriving interface implementations from two interfaces. More...
class 
Mixin class template for deriving singleton interface implementations, where the reference count is fixed to one. More...
class 
This mixin merges the implementation of one interface with a second interface. More...
struct 
A 128 bit representation of a universally unique identifier (UUID or GUID). More...
class 
Class template for a compile-time representation of universally unique identifiers (UUIDs or GUIDs). More...

Typedefs

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

Functions

const IInterface* mi::base::Interface_merger::get_interface( const Uuid& interface_id) const
Reimplements mi::base::IInterface::get_interface(const Uuid&) const. More...
IInterface* mi::base::Interface_merger::get_interface( const Uuid& interface_id)
Reimplements mi::base::IInterface::get_interface(const Uuid&). 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...
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.
bool  mi::base::operator!=( const Uuid& id1, const Uuid& id2)
Returns true if id1 is not equal to id2.
bool  mi::base::operator<( const Uuid& id1, const Uuid& id2)
Returns true if id1 is less than id2.
bool  mi::base::operator<=( const Uuid& id1, const Uuid& id2)
Returns true if id1 is less than or equal to id2.
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.
bool  mi::base::operator==( const Uuid& id1, const Uuid& id2)
Returns true if id1 is equal to id2.
bool  mi::base::operator>( const Uuid& id1, const Uuid& id2)
Returns true if id1 is greater than id2.
bool  mi::base::operator>=( const Uuid& id1, const Uuid& id2)
Returns true if id1 is greater than or equal to id2.
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.

Variables

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

Typedefs

typedef 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)

Functions

const IInterface* mi::base::Interface_merger::get_interface( const Uuid& interface_id) const [inline]

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.

IInterface* mi::base::Interface_merger::get_interface( const Uuid& interface_id) [inline]

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.

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 not equal to id2.

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.

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 equal to id2.

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.

Variables

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)