rwlogo

Rogue Wave Views
Foundation Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
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...
 
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...
 
void setInterface (INTERFACE *interf)
 This function replaces the previous interface stored in this object by a new one. More...
 

Protected Member Functions

 IlvAbstractCOMInterface ()
 Default constructor. More...
 
 IlvAbstractCOMInterface (IlvAbstractCOMInterface const &other)
 Copy constructor. More...
 
 IlvAbstractCOMInterface (CntPtr const &initObj)
 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

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

Destructor.

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

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.

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.

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

template<class INTERFACE >
IlvAbstractCOMInterface< INTERFACE >::CntPtr const & IlvAbstractCOMInterface< INTERFACE >::getInitializer ( ) const
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.
template<class INTERFACE >
INTERFACE * IlvAbstractCOMInterface< INTERFACE >::getInterface ( ) const

This member function returns the interface associated to this class.

Returns
A pointer to an INTERFACE (type given as parameter of the template).
template<class INTERFACE >
IlvAbstractCOMInterface< INTERFACE >::operator INTERFACE * ( ) const

This operator returns the interface associated to this class.

Returns
A pointer to an INTERFACE (type given as parameter of the template).
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).
template<class INTERFACE >
INTERFACE * IlvAbstractCOMInterface< INTERFACE >::operator-> ( ) const

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

Returns
the pointer to the INTERFACE.
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.
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).

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.


© Copyright 2015, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.