MDL SDK API nvidia_logo_transpbg.gif Up
mi::base::Interface_implement_singleton<I> Class Template Reference

Mixin class template for deriving singleton interface implementations, where the reference count is fixed to one. More...

#include <interface_implement.h>

Inherits I.

Public Member Functions

Uint32 retain () const override
 Returns the fixed reference count of one. More...
 
Uint32 release () const override
 Returns the fixed reference count of one. More...
 
const IInterfaceget_interface (const Uuid &interface_id) const override
 Acquires a const interface. More...
 
IInterfaceget_interface (const Uuid &interface_id) override
 Acquires a mutable interface. More...
 
Uuid get_iid () const override
 Returns the interface ID of the most derived interface. More...
 

Detailed Description

template<class I>
class mi::base::Interface_implement_singleton<I>

Mixin class template for deriving singleton interface implementations, where the reference count is fixed to one.

mi::base::Interface_implement is a mixin class template that allows you to derive interface class implementations easily. It provides you with a special implementation of reference counting and the mi::base::IInterface::get_interface(const Uuid&) method. It requires that you used interfaces derived from the corresponding mixin class template mi::base::Interface_declare.

The reference counting is fixed to have a count of always one. It is suitable, for example, for singleton objects that get once allocated and never deallocated.

mi::base::Interface_implement is derived from the interface I.

Template Parameters
IThe interface class that this class implements.