7#ifndef MI_BASE_INTERFACE_IMPLEMENT_H
8#define MI_BASE_INTERFACE_IMPLEMENT_H
74#if (__cplusplus >= 201103L)
77 : m_refcnt{other.m_refcnt.swap(0)}
84 other.m_refcnt = m_refcnt.
swap(other.m_refcnt);
123 return I::get_interface_static(
this, interface_id);
138 return I::get_interface_static(
this, interface_id);
141 using I::get_interface;
146 return typename I::IID();
157 mutable Atom32 m_refcnt;
178template <
class I1,
class I2>
245 const IInterface* iptr = I1::get_interface_static(
static_cast<const I1*
>(
this),
248 iptr = I2::get_interface_static(
static_cast<const I2*
>(
this), interface_id);
264 IInterface* iptr = I1::get_interface_static(
static_cast<I1*
>(
this),interface_id);
266 iptr = I2::get_interface_static(
static_cast<I2*
>(
this), interface_id);
270 using I1::get_interface;
275 return typename I1::IID();
282 mutable Atom32 m_refcnt;
336 return I::get_interface_static(
this, interface_id);
351 return I::get_interface_static(
this, interface_id);
354 using I::get_interface;
359 return typename I::IID();
32-bit unsigned counter with atomic arithmetic, increments, and decrements.
A 32-bit unsigned counter with atomic arithmetic, increments, and decrements.
Definition: atom.h:41
The basic extensible interface.
Definition: iinterface.h:103
Mixin class template for deriving interface implementations from two interfaces.
Definition: interface_implement.h:180
Mixin class template for deriving singleton interface implementations, where the reference count is f...
Definition: interface_implement.h:304
Mixin class template for deriving interface implementations.
Definition: interface_implement.h:41
Interface_implement(const Interface_implement<I> &other)
Copy constructor.
Definition: interface_implement.h:56
virtual Uint32 release() const
Decrements the reference count.
Definition: interface_implement.h:103
Atom32 & refcount() const
Get the current refcount.
Definition: interface_implement.h:151
virtual Uint32 release() const
Decrements the reference count.
Definition: interface_implement.h:225
virtual const IInterface * get_interface(const Uuid &interface_id) const
Acquires a const interface.
Definition: interface_implement.h:121
Interface_implement_2(Uint32 initial=1)
Constructor.
Definition: interface_implement.h:185
virtual IInterface * get_interface(const Uuid &interface_id)
Acquires a mutable interface.
Definition: interface_implement.h:349
Interface_implement(Interface_implement &&other)
Move constructor.
Definition: interface_implement.h:76
virtual Uint32 retain() const
Increments the reference count.
Definition: interface_implement.h:215
Interface_implement_2(const Interface_implement_2<I1, I2> &other)
Copy constructor.
Definition: interface_implement.h:193
virtual Uint32 release() const
Returns the fixed reference count of one.
Definition: interface_implement.h:319
virtual Uint32 retain() const
Returns the fixed reference count of one.
Definition: interface_implement.h:310
Interface_implement<I> & operator=(const Interface_implement<I> &other)
Assignment operator.
Definition: interface_implement.h:66
virtual IInterface * get_interface(const Uuid &interface_id)
Acquires a mutable interface.
Definition: interface_implement.h:136
Uuid get_iid() const
Returns the interface ID of the most derived interface.
Definition: interface_implement.h:357
Interface_implement(Uint32 initial=1)
Constructor.
Definition: interface_implement.h:48
virtual const IInterface * get_interface(const Uuid &interface_id) const
Acquires a const interface.
Definition: interface_implement.h:243
virtual IInterface * get_interface(const Uuid &interface_id)
Acquires a mutable interface.
Definition: interface_implement.h:262
Uuid get_iid() const
Returns the interface ID of the most derived interface.
Definition: interface_implement.h:273
virtual Uint32 retain() const
Increments the reference count.
Definition: interface_implement.h:93
Interface_implement_2<I1, I2> & operator=(const Interface_implement_2<I1, I2> &other)
Assignment operator.
Definition: interface_implement.h:203
virtual const IInterface * get_interface(const Uuid &interface_id) const
Acquires a const interface.
Definition: interface_implement.h:334
Uuid get_iid() const
Returns the interface ID of the most derived interface.
Definition: interface_implement.h:144
Interface_implement & operator=(Interface_implement &&other)
Move assignment.
Definition: interface_implement.h:82
Uint32 swap(const Uint32 rhs)
Assigns rhs to the counter and returns the old value of counter.
unsigned int Uint32
32-bit unsigned integer.
Definition: types.h:49
Common namespace for APIs of NVIDIA Advanced Rendering Center GmbH.
Definition: dice.h:89
A 128 bit representation of a universally unique identifier (UUID or GUID).
Definition: uuid.h:26
A 128 bit representation of a universally unique identifier (UUID or GUID).