| # Gaudi Framework, version v22r2 |

Home |  | Generated: Tue May 10 2011

Public Member Functions | Public Attributes

# check_cast< THIS > Struct Template Reference

Helper class for the cast used in the MPL for_each algorithm in the implementation of i_cast. More...

`#include <implements.h>`

Collaboration diagram for check_cast< THIS >:
[legend]

List of all members.

## Public Member Functions
| check_cast (const THIS *_instance, const std::type_info &_tid, void *&_ptr)
template<typename IID >
void | operator() (IID)
## Public Attributes
const std::type_info & | target
| type_info for the requested interface.
void *& | ptr
| Pointer to be filled.
const THIS * | instance
| Value of this.

## Detailed Description

### template<typename THIS>
struct check_cast< THIS >

Helper class for the cast used in the MPL for_each algorithm in the implementation of i_cast.

Author:
  Marco Clemencic

Definition at line 10 of file implements.h.

## Constructor & Destructor Documentation

template<typename THIS >

check_cast< THIS >::check_cast | ( | const THIS * | _instance,
|  | const std::type_info & | _tid,
|  | void *& | _ptr
| ) |  | `[inline]`

Definition at line 17 of file implements.h.

                                                                               :
        target(_tid),
        ptr(_ptr),
        instance(_instance){}

## Member Function Documentation

template<typename THIS >
template<typename IID >

void check_cast< THIS >::operator() | ( | IID | ) | `[inline]`

Definition at line 23 of file implements.h.

                                   {
        if ((!ptr) && (typeid(typename IID::iids::type) == target)) {
          ptr = const_cast<void*>(reinterpret_cast<const void*>(static_cast<const typename IID::iface_type*>(instance)));
        }
      }

## Member Data Documentation

template<typename THIS >

const THIS* check_cast< THIS >::instance

Value of this.

Definition at line 16 of file implements.h.

template<typename THIS >

void*& check_cast< THIS >::ptr

Pointer to be filled.

Definition at line 14 of file implements.h.

template<typename THIS >

const std::type_info& check_cast< THIS >::target

type_info for the requested interface.

Definition at line 12 of file implements.h.

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

- /afs/.cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v22r2/GaudiKernel/GaudiKernel/implements.h

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines