Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  v31r0 (aeb156f0)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Interface.h
Go to the documentation of this file.
1 // ============================================================================
2 #ifndef GAUDIPYTHON_INTERFACE_H
3 #define GAUDIPYTHON_INTERFACE_H 1
4 // ============================================================================
5 // Include files
6 // ============================================================================
7 // STD & STL
8 // ============================================================================
9 #include <functional>
10 // ============================================================================
11 // GaudiKernel
12 // ============================================================================
13 #include "GaudiKernel/IInterface.h"
14 #include "GaudiKernel/SmartIF.h"
15 // ============================================================================
16 // GaudiPython
17 // ============================================================================
19 // ============================================================================
20 
21 namespace GaudiPython {
32  template <class TYPE>
33  struct Interface {
38  TYPE* operator()( const IInterface* in ) const {
39  return SmartIF<TYPE>( TYPE::interfaceID(), const_cast<IInterface*>( in ) );
40  }
41 
46  static TYPE* cast( const IInterface* in ) { return SmartIF<TYPE>( const_cast<IInterface*>( in ) ); }
47 
53  static TYPE* cast( const InterfaceID& iid, const IInterface* in ) {
54  return SmartIF<TYPE>( iid, const_cast<IInterface*>( in ) );
55  }
56  };
57 
58  template <>
60  typedef IInterface TYPE;
65  TYPE* operator()( const IInterface* in ) const { return SmartIF<TYPE>( const_cast<IInterface*>( in ) ); }
66 
71  static TYPE* cast( const IInterface* in ) { return SmartIF<TYPE>( const_cast<IInterface*>( in ) ); }
72 
78  static TYPE* cast( const InterfaceID& /* iid */, const IInterface* in ) {
79  return SmartIF<TYPE>( const_cast<IInterface*>( in ) );
80  }
81  };
82 
83 } // end of namespace GaudiPython
84 
85 #endif // GAUDIPYTHON_INTERFACE_H
Small smart pointer class with automatic reference counting for IInterface.
Definition: IConverter.h:15
static TYPE * cast(const InterfaceID &iid, const IInterface *in)
the only one important method (static)
Definition: Interface.h:53
Interface ID class.
Definition: IInterface.h:29
TYPE * operator()(const IInterface *in) const
the only one important method
Definition: Interface.h:65
static TYPE * cast(const IInterface *in)
the only one important method (static)
Definition: Interface.h:71
Definition of the basic interface.
Definition: IInterface.h:244
GaudiPython.h GaudiPython/GaudiPython.h.
Definition: AlgDecorators.h:37
static TYPE * cast(const InterfaceID &, const IInterface *in)
the only one important method (static)
Definition: Interface.h:78
TYPE * operator()(const IInterface *in) const
the only one important method
Definition: Interface.h:38
Minor mofidication of original Pere&#39;s structure GaudiPython::Interface This helper class is nesessary...
Definition: Interface.h:33
static TYPE * cast(const IInterface *in)
the only one important method (static)
Definition: Interface.h:46