Gaudi Framework, version v22r0

Home   Generated: 9 Feb 2011

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 >:
Collaboration graph
[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_infotarget
 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.

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

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 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:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines

Generated at Wed Feb 9 16:30:19 2011 for Gaudi Framework, version v22r0 by Doxygen version 1.6.2 written by Dimitri van Heesch, © 1997-2004