COM Library
Public Member Functions | Protected Member Functions | Private Attributes
COM::ObjectBase< Base > Class Template Reference

The base class for all COM objects. More...

#include <ObjectBase.hpp>

Inheritance diagram for COM::ObjectBase< Base >:

List of all members.

Public Member Functions

 ObjectBase ()
 Default constructor.
virtual ~ObjectBase ()
 Destructor.
ULONG GetRefCount () const
 Get the object reference count.
virtual HRESULT QueryInterfaceImpl (const IID &rIID, void **ppInterface)
 Query the object for a particular interface.
virtual ULONG AddRefImpl ()
 Increment the objects reference count.
virtual ULONG ReleaseImpl ()
 Decrement the objects reference count.
virtual HRESULT InterfaceSupportsErrorInfoImpl (const IID &rIID)
 Queries if the interface supports COM exceptiopns.

Protected Member Functions

virtual void * interface_cast (const IID &rIID)=0
 Template Method used to obtain the requested interface, if supported.

Private Attributes

LONG m_nRefCount
 The object reference count.

Detailed Description

template<typename Base = IUnknown>
class COM::ObjectBase< Base >

The base class for all COM objects.

This provides an implementation of IUnknown for dynamically allocated objects. It also marks the interface as supporting COM exceptions which are handled automatically by the macro COM_CATCH_* in ErrorInfo.hpp.


Constructor & Destructor Documentation

template<typename Base >
COM::ObjectBase< Base >::ObjectBase ( ) [inline]

Default constructor.

template<typename Base >
COM::ObjectBase< Base >::~ObjectBase ( ) [inline, virtual]

Destructor.


Member Function Documentation

template<typename Base >
ULONG COM::ObjectBase< Base >::GetRefCount ( ) const [inline]

Get the object reference count.

template<typename Base >
HRESULT COM::ObjectBase< Base >::QueryInterfaceImpl ( const IID &  rIID,
void **  ppInterface 
) [inline, virtual]

Query the object for a particular interface.

template<typename Base >
ULONG COM::ObjectBase< Base >::AddRefImpl ( ) [inline, virtual]

Increment the objects reference count.

template<typename Base >
ULONG COM::ObjectBase< Base >::ReleaseImpl ( ) [inline, virtual]

Decrement the objects reference count.

template<typename Base >
HRESULT COM::ObjectBase< Base >::InterfaceSupportsErrorInfoImpl ( const IID &  rIID) [inline, virtual]

Queries if the interface supports COM exceptiopns.

template<typename Base = IUnknown>
virtual void* COM::ObjectBase< Base >::interface_cast ( const IID &  rIID) [protected, pure virtual]

Template Method used to obtain the requested interface, if supported.


Member Data Documentation

template<typename Base = IUnknown>
LONG COM::ObjectBase< Base >::m_nRefCount [private]

The object reference count.


The documentation for this class was generated from the following file: