#include <GaudiKernel/SmartIF.h>
Inheritance diagram for SmartIF< TYPE >:
Public Member Functions | |
SmartIF (const InterfaceID &iid, IInterface *iface) | |
Standard constructor with initialisation. | |
SmartIF (const InterfaceID &iid, TYPE *iface) | |
Standard constructor with initialisation. | |
SmartIF (const InterfaceID &iid) | |
Standard constructor with initialisation. | |
SmartIF (TYPE *iface) | |
Standard constructor with initialisation. | |
SmartIF (IInterface *iface=0) | |
Standard constructor with initialisation. | |
SmartIF (const SmartIF< TYPE > ©) | |
Copy constructor. | |
virtual | ~SmartIF () |
Standard destructor. | |
SmartIF< TYPE > & | operator= (int) |
Simple assignment operator. | |
template<class T> | |
SmartIF< TYPE > & | operator= (const SmartIF< T > &iface) |
Copy assignment operator with conversion to requested interface type. | |
SmartIF< TYPE > & | operator= (const SmartIF< TYPE > &iface) |
Copy assignment operator. | |
SmartIF & | operator= (IInterface *iface) |
Assignment operator with conversion to requested interface type. | |
SmartIF< TYPE > & | operator= (TYPE *iface) |
Simple assignment operator. | |
bool | operator! () const |
check the validity of the interface | |
bool | isValid () const |
Allow for check if smart pointer is valid. | |
operator TYPE * () | |
Automatic conversion to constined interface type. | |
operator const TYPE * () const | |
Automatic conversion to constined interface type (CONST). | |
bool | operator!= (const TYPE *test) const |
Check for non-equality. | |
bool | operator== (const TYPE *test) const |
Check for equality. | |
TYPE * | operator-> () |
Dereference operator. | |
const TYPE * | operator-> () const |
Dereference operator (CONST). | |
void ** | operator & () |
Allow for use as void pointer. | |
const TYPE * | get () |
Get reference to interface pointer. | |
TYPE *& | pRef () |
Get reference to interface pointer. | |
const TYPE *const & | pRef () const |
Get reference to interface pointer (CONST). | |
Protected Member Functions | |
void | releaseInterface () |
Release interface. | |
Protected Attributes | |
const InterfaceID | m_iid |
TYPE * | m_interface |
Description: A small class to easy the use of Gaudi interfaces.
Base Class: SmartIFBase<TYPE>
History :
+---------+----------------------------------------------+--------+ | Date | Comment | Who | +---------+----------------------------------------------+--------+ | 30/10/99| Initial version. | MF | +---------+----------------------------------------------+--------+Author: M.Frank Version: 1.0
Definition at line 120 of file SmartIF.h.
SmartIF< TYPE >::SmartIF | ( | const InterfaceID & | iid, | |
IInterface * | iface | |||
) | [inline] |
Standard constructor with initialisation.
Definition at line 123 of file SmartIF.h.
00123 : SmartIFBase<TYPE>(iid) { 00124 SmartIF<TYPE>::operator=(iface); 00125 }
SmartIF< TYPE >::SmartIF | ( | const InterfaceID & | iid, | |
TYPE * | iface | |||
) | [inline] |
Standard constructor with initialisation.
Definition at line 127 of file SmartIF.h.
00127 : SmartIFBase<TYPE>(iid) { 00128 SmartIF<TYPE>::operator=(iface); 00129 }
SmartIF< TYPE >::SmartIF | ( | const InterfaceID & | iid | ) | [inline] |
Standard constructor with initialisation.
Definition at line 131 of file SmartIF.h.
00131 : SmartIFBase<TYPE>(iid) { 00132 }
Standard constructor with initialisation.
Definition at line 134 of file SmartIF.h.
00134 : SmartIFBase<TYPE>(TYPE::interfaceID()) { 00135 SmartIF<TYPE>::operator=(iface); 00136 }
SmartIF< TYPE >::SmartIF | ( | IInterface * | iface = 0 |
) | [inline] |
Standard constructor with initialisation.
Definition at line 138 of file SmartIF.h.
00138 : SmartIFBase<TYPE>(TYPE::interfaceID()) { 00139 SmartIF<TYPE>::operator=(iface); 00140 }
Copy constructor.
Definition at line 142 of file SmartIF.h.
00142 : SmartIFBase<TYPE>(copy.m_iid) { 00143 SmartIF<TYPE>::operator=(copy.m_interface); 00144 }
Simple assignment operator.
Definition at line 149 of file SmartIF.h.
00149 { 00150 this->releaseInterface(); 00151 this->m_interface = 0; 00152 return *this; 00153 }
SmartIF<TYPE>& SmartIF< TYPE >::operator= | ( | const SmartIF< T > & | iface | ) | [inline] |
Copy assignment operator with conversion to requested interface type.
Definition at line 156 of file SmartIF.h.
00157 { 00158 T* ptr = iface.m_interface ; 00159 if ( (void*)ptr != (void*)this->m_interface ) 00160 { 00161 TYPE* newIF = 0; 00162 if ( ptr != 0 ) { 00163 ptr->queryInterface(this->m_iid, pp_cast<void>(&newIF)).ignore(); 00164 } 00165 this->releaseInterface(); 00166 this->m_interface = newIF; 00167 } 00168 return *this; 00169 }
SmartIF<TYPE>& SmartIF< TYPE >::operator= | ( | const SmartIF< TYPE > & | iface | ) | [inline] |
Copy assignment operator.
Definition at line 171 of file SmartIF.h.
00172 { 00173 TYPE* newIF = iface.m_interface ; 00174 return (*this)=newIF ; 00175 }
SmartIF& SmartIF< TYPE >::operator= | ( | IInterface * | iface | ) | [inline] |
Assignment operator with conversion to requested interface type.
Definition at line 177 of file SmartIF.h.
00178 { 00179 if ( iface != this->m_interface ) 00180 { 00181 TYPE* newIF = 0; 00182 if ( iface != 0 ) { 00183 iface->queryInterface(this->m_iid, pp_cast<void>(&newIF)).ignore(); 00184 } 00185 this->releaseInterface(); 00186 this->m_interface = newIF; 00187 } 00188 return *this; 00189 }
Simple assignment operator.
Definition at line 191 of file SmartIF.h.
00192 { 00193 if ( iface != this->m_interface ) { 00194 if ( iface != 0 ) { 00195 iface->addRef(); 00196 } 00197 this->releaseInterface(); 00198 this->m_interface = iface; 00199 } 00200 return *this; 00201 }
bool SmartIF< TYPE >::operator! | ( | ) | const [inline] |
check the validity of the interface
Reimplemented from SmartIFBase< TYPE >.
Definition at line 203 of file SmartIF.h.
00203 { return !(this->isValid()) ; }
void SmartIFBase< TYPE >::releaseInterface | ( | ) | [inline, protected, inherited] |
Release interface.
Definition at line 36 of file SmartIF.h.
00036 { 00037 if ( m_interface ) m_interface->release(); 00038 m_interface = 0; 00039 }
bool SmartIFBase< TYPE >::isValid | ( | ) | const [inline, inherited] |
Allow for check if smart pointer is valid.
Definition at line 49 of file SmartIF.h.
00049 { 00050 return ( 0 != m_interface ); 00051 }
SmartIFBase< TYPE >::operator TYPE * | ( | ) | [inline, inherited] |
Automatic conversion to constined interface type.
Definition at line 53 of file SmartIF.h.
00053 { 00054 return m_interface; 00055 }
SmartIFBase< TYPE >::operator const TYPE * | ( | ) | const [inline, inherited] |
Automatic conversion to constined interface type (CONST).
Definition at line 57 of file SmartIF.h.
00057 { 00058 return m_interface; 00059 }
bool SmartIFBase< TYPE >::operator!= | ( | const TYPE * | test | ) | const [inline, inherited] |
Check for non-equality.
Definition at line 61 of file SmartIF.h.
00061 { 00062 return test != m_interface; 00063 }
bool SmartIFBase< TYPE >::operator== | ( | const TYPE * | test | ) | const [inline, inherited] |
Check for equality.
Definition at line 65 of file SmartIF.h.
00065 { 00066 return test == m_interface; 00067 }
TYPE* SmartIFBase< TYPE >::operator-> | ( | ) | [inline, inherited] |
Dereference operator.
Definition at line 69 of file SmartIF.h.
00069 { 00070 return m_interface; 00071 }
const TYPE* SmartIFBase< TYPE >::operator-> | ( | ) | const [inline, inherited] |
Dereference operator (CONST).
Definition at line 73 of file SmartIF.h.
00073 { 00074 return m_interface; 00075 }
void** SmartIFBase< TYPE >::operator & | ( | ) | [inline, inherited] |
Allow for use as void pointer.
Definition at line 77 of file SmartIF.h.
00077 { 00078 return (void**) &m_interface; 00079 }
const TYPE* SmartIFBase< TYPE >::get | ( | ) | [inline, inherited] |
Get reference to interface pointer.
Definition at line 81 of file SmartIF.h.
00081 { 00082 return m_interface; 00083 }
TYPE*& SmartIFBase< TYPE >::pRef | ( | ) | [inline, inherited] |
Get reference to interface pointer.
Definition at line 85 of file SmartIF.h.
00085 { 00086 return this->m_interface; 00087 }
const TYPE* const& SmartIFBase< TYPE >::pRef | ( | ) | const [inline, inherited] |
Get reference to interface pointer (CONST).
Definition at line 89 of file SmartIF.h.
00089 { 00090 return this->m_interface; 00091 }
const InterfaceID SmartIFBase< TYPE >::m_iid [protected, inherited] |
TYPE* SmartIFBase< TYPE >::m_interface [protected, inherited] |