| # Gaudi Framework, version v21r9 |

Home |  | Generated: 3 May 2010

# 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.

    00017                                                                            :
    00018     target(_tid),
    00019     ptr(_ptr),
    00020     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.

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

## Member Data Documentation

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.

template<typename THIS>

void*& check_cast< THIS >::ptr

Pointer to be filled.

Definition at line 14 of file implements.h.

template<typename THIS>

const THIS* check_cast< THIS >::instance

Value of this.

Definition at line 16 of file implements.h.

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

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