Views
Foundation Package API Reference Guide
Product Documentation:
Views Documentation Home
List of all members | Public Member Functions | Protected Member Functions
IlvAbstractCOMInterface< INTERFACE > Class Template Referenceabstract

This pure template abstract class is a base class for COM encapsulation. More...

#include <ilviews/windows/com.h>

Inheritance diagram for IlvAbstractCOMInterface< INTERFACE >:
IlvATLInterface< INTERFACE > IlvCOMInterface< INTERFACE > IlvCOMInterfaceFromCLSID< INTERFACE >

Public Member Functions

virtual ~IlvAbstractCOMInterface ()=0
 Destructor. More...
 
INTERFACE * getInterface () const
 This member function returns the interface associated to this class. More...
 
 operator INTERFACE * () const
 This operator returns the interface associated to this class. More...
 
 operator INTERFACE const * () const
 This const operator returns the interface associated to this class. More...
 
INTERFACE * operator-> () const
 This operator lets the class to be used as a plain pointer. More...
 
void setInterface (INTERFACE *interf)
 This function replaces the previous interface stored in this object by a new one. More...
 
HRESULT setInterface (IUnknown *iunk, REFIID iid)
 This function modifies the interface stored by this object through a call to the function QueryInterface of the IUnknown interface. More...
 

Protected Member Functions

 IlvAbstractCOMInterface ()
 Default constructor. More...
 
 IlvAbstractCOMInterface (CntPtr const &initObj)
 Constructor. More...
 
 IlvAbstractCOMInterface (IlvAbstractCOMInterface const &other)
 Copy constructor. More...
 
CntPtr const & getInitializer () const
 This function returns a reference counter to the library initializer. More...
 
IlvAbstractCOMInterfaceoperator= (IlvAbstractCOMInterface const &other)
 Assignment operator. More...
 

Detailed Description

template<class INTERFACE>
class IlvAbstractCOMInterface< INTERFACE >

This pure template abstract class is a base class for COM encapsulation.

Library: ilvcom

It defines the member function to return an interface. The type of the interface is given as parameter of the template.

Constructor & Destructor Documentation

◆ ~IlvAbstractCOMInterface()

template<class INTERFACE >
IlvAbstractCOMInterface< INTERFACE >::~IlvAbstractCOMInterface
pure virtual

Destructor.

It releases the interface if necessary. It is defined as a pure virtual function.

◆ IlvAbstractCOMInterface() [1/3]

template<class INTERFACE >
IlvAbstractCOMInterface< INTERFACE >::IlvAbstractCOMInterface
protected

Default constructor.

The constructors are protected and can only be used in derived classes. This one just initializes the internal data members and initializes the COM library, if needed, through _initializeObject.

◆ IlvAbstractCOMInterface() [2/3]

template<class INTERFACE >
IlvAbstractCOMInterface< INTERFACE >::IlvAbstractCOMInterface ( IlvAbstractCOMInterface< INTERFACE > const &  other)
protected

Copy constructor.

The constructors are protected and can only be used in derived classes. This one just initializes the internal data members by copying the values from the object other. It does not initialize the COM library.

◆ IlvAbstractCOMInterface() [3/3]

template<class INTERFACE >
IlvAbstractCOMInterface< INTERFACE >::IlvAbstractCOMInterface ( CntPtr const &  initObj)
protected

Constructor.

The constructors are protected and can only be used in derived classes. This one just initializes the internal data members to default values. The _initializeObject data member is a copy of initObj. It does not initialize the COM library.

Parameters
initObjMust only be a reference to a reference counter to an IlvCOMLibraryInitialization object.

Member Function Documentation

◆ getInitializer()

template<class INTERFACE >
IlvAbstractCOMInterface< INTERFACE >::CntPtr const & IlvAbstractCOMInterface< INTERFACE >::getInitializer
protected

This function returns a reference counter to the library initializer.

This function can only be used in the inherited classes.

Returns
A reference counter to an IlvAbstractLibraryInitialization object.

◆ getInterface()

template<class INTERFACE >
INTERFACE * IlvAbstractCOMInterface< INTERFACE >::getInterface

This member function returns the interface associated to this class.

Returns
A pointer to an INTERFACE (type given as parameter of the template).

◆ operator INTERFACE *()

template<class INTERFACE >
IlvAbstractCOMInterface< INTERFACE >::operator INTERFACE *

This operator returns the interface associated to this class.

Returns
A pointer to an INTERFACE (type given as parameter of the template).

◆ operator INTERFACE const *()

template<class INTERFACE >
IlvAbstractCOMInterface< INTERFACE >::operator INTERFACE const * ( ) const

This const operator returns the interface associated to this class.

Returns
A const pointer to an INTERFACE (type given as parameter of the template).

◆ operator->()

template<class INTERFACE >
INTERFACE * IlvAbstractCOMInterface< INTERFACE >::operator->

This operator lets the class to be used as a plain pointer.

Returns
the pointer to the INTERFACE.

◆ operator=()

template<class INTERFACE >
IlvAbstractCOMInterface< INTERFACE > & IlvAbstractCOMInterface< INTERFACE >::operator= ( IlvAbstractCOMInterface< INTERFACE > const &  other)
protected

Assignment operator.

This operator assigns the given IlvAbstractCOMInterface<INTERFACE> to this. It returns *this.

Parameters
otherA constant reference to an IlvAbstractCOMInterface<INTERFACE> object.
Returns
A reference to the current object.

◆ setInterface() [1/2]

template<class INTERFACE >
void IlvAbstractCOMInterface< INTERFACE >::setInterface ( INTERFACE *  interf)

This function replaces the previous interface stored in this object by a new one.

If the previous interface was not null, then the function Release is called for the previous interface stored by the object. It the new interface is not null, the function AddRef is called for this new interface.

◆ setInterface() [2/2]

template<class INTERFACE >
HRESULT IlvAbstractCOMInterface< INTERFACE >::setInterface ( IUnknown *  iunk,
REFIID  iid 
)

This function modifies the interface stored by this object through a call to the function QueryInterface of the IUnknown interface.

When an error occurs, the interface is not changed. Otherwise the function Release is called for the previous interface stored by the object (if any).