| # Gaudi Framework, version v22r2 |

Home |  | Generated: Tue May 10 2011

Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends

# ObjectMemberFunction< CallerClass > Class Template Reference

This class is used by IUpdateManagerSvc to keep pairs made of a member function and a pointer to the object for which that member function has to be called. More...

`#include <IUpdateManagerSvc.h>`

Inheritance diagram for ObjectMemberFunction< CallerClass >:
[legend]
Collaboration diagram for ObjectMemberFunction< CallerClass >:
[legend]

List of all members.

## Public Types
typedef StatusCode(CallerClass::* | MemberFunctionType )()
| MemberFunctionType is the type for a pointer to a member function of class CallerClass.
## Public Member Functions
virtual | ~ObjectMemberFunction ()
| Virtual destructor.
virtual StatusCode | operator() () const
| Calls the member function of the object and returns the StatusCode.
virtual BaseObjectMemberFunction * | makeCopy () const
| Clone method to be able to copy an ObjectMemberFunction from the BaseObjectMemberFunction interface.
virtual const std::type_info & | type () const
| Returns the type_info of the CallerClass.
virtual bool | match (BaseObjectMemberFunction *bmf) const
| Comparison between two BaseObjectMemberFunction instances.
virtual DataObject * | castToDataObject () const
| Cast the object to DataObject.
virtual ValidDataObject * | castToValidDataObject () const
| Cast the object to ValidDataObject.
virtual void * | castToVoid () const
| Cast the object to void with dynamic_cast.
## Protected Member Functions
| ObjectMemberFunction (CallerClass *instance, const MemberFunctionType &mf)
| Standard constructor. Protected so that can be called only by itself or IUpdateManagerSvc.
## Protected Attributes
CallerClass * | m_instance
| Pointer to the object.
MemberFunctionType | m_memberFunction
| Pointer to the member function.
## Friends
class | IUpdateManagerSvc

## Detailed Description

### template<class CallerClass>
class ObjectMemberFunction< CallerClass >

This class is used by IUpdateManagerSvc to keep pairs made of a member function and a pointer to the object for which that member function has to be called.

Author:
  Marco Clemencic

Definition at line 54 of file IUpdateManagerSvc.h.

## Member Typedef Documentation

template<class CallerClass>

typedef StatusCode(CallerClass::* ObjectMemberFunction< CallerClass >::MemberFunctionType)()

MemberFunctionType is the type for a pointer to a member function of class CallerClass.

Definition at line 57 of file IUpdateManagerSvc.h.

## Constructor & Destructor Documentation

template<class CallerClass>

virtual ObjectMemberFunction< CallerClass >::~ObjectMemberFunction | ( | ) | `[inline, virtual]`

Virtual destructor.

Definition at line 60 of file IUpdateManagerSvc.h.

    {};

template<class CallerClass>

ObjectMemberFunction< CallerClass >::ObjectMemberFunction | ( | CallerClass * | instance,
|  | const MemberFunctionType & | mf
| ) |  | `[inline, protected]`

Standard constructor. Protected so that can be called only by itself or IUpdateManagerSvc.

Definition at line 108 of file IUpdateManagerSvc.h.

                                                                               :
        m_instance(instance),m_memberFunction(mf){}

## Member Function Documentation

template<class CallerClass>

virtual DataObject* ObjectMemberFunction< CallerClass >::castToDataObject | ( | ) | const`[inline, virtual]`

Cast the object to DataObject.

Implements BaseObjectMemberFunction.

Definition at line 91 of file IUpdateManagerSvc.h.

                                                   {
        return dynamic_cast<DataObject*>(m_instance);
      }

template<class CallerClass>

virtual ValidDataObject* ObjectMemberFunction< CallerClass >::castToValidDataObject | ( | ) | const`[inline, virtual]`

Cast the object to ValidDataObject.

Implements BaseObjectMemberFunction.

Definition at line 96 of file IUpdateManagerSvc.h.

                                                             {
        return dynamic_cast<ValidDataObject*>(m_instance);
      }

template<class CallerClass>

virtual void* ObjectMemberFunction< CallerClass >::castToVoid | ( | ) | const`[inline, virtual]`

Cast the object to void with dynamic_cast.

Implements BaseObjectMemberFunction.

Definition at line 101 of file IUpdateManagerSvc.h.

                                       {
        return dynamic_cast<void*>(m_instance);
      }

template<class CallerClass>

virtual BaseObjectMemberFunction* ObjectMemberFunction< CallerClass >::makeCopy | ( | ) | const`[inline, virtual]`

Clone method to be able to copy an ObjectMemberFunction from the BaseObjectMemberFunction interface.

Implements BaseObjectMemberFunction.

Definition at line 72 of file IUpdateManagerSvc.h.

                                                         {
        return new ObjectMemberFunction<CallerClass>(m_instance,m_memberFunction);
      }

template<class CallerClass>

virtual bool ObjectMemberFunction< CallerClass >::match | ( | BaseObjectMemberFunction< CallerClass > * | bmf ) | const`[inline, virtual]`

Comparison between two BaseObjectMemberFunction instances.

Implements BaseObjectMemberFunction.

Definition at line 80 of file IUpdateManagerSvc.h.

                                                              {
        if ( bmf == (BaseObjectMemberFunction *)this ) return true;
        if (type() == bmf->type()) {
          ObjectMemberFunction * mf = dynamic_cast<ObjectMemberFunction *>(bmf);
          return m_instance == mf->m_instance &&
            m_memberFunction == mf->m_memberFunction;
        }
        return false;
      }

template<class CallerClass>

virtual StatusCode ObjectMemberFunction< CallerClass >::operator() | ( | ) | const`[inline, virtual]`

Calls the member function of the object and returns the StatusCode.

If the pointer to the member function is NULL, do nothing and return success.

Implements BaseObjectMemberFunction.

Definition at line 64 of file IUpdateManagerSvc.h.

                                             {
        return (m_memberFunction != NULL)?
          (m_instance->*m_memberFunction)() :
          StatusCode::SUCCESS;
      }

template<class CallerClass>

virtual const std::type_info& ObjectMemberFunction< CallerClass >::type | ( | ) | const`[inline, virtual]`

Returns the type_info of the CallerClass.

Implements BaseObjectMemberFunction.

Definition at line 77 of file IUpdateManagerSvc.h.

    { return typeid(CallerClass); }

## Friends And Related Function Documentation

template<class CallerClass>

friend class IUpdateManagerSvc`[friend]`

Definition at line 117 of file IUpdateManagerSvc.h.

## Member Data Documentation

template<class CallerClass>

CallerClass* ObjectMemberFunction< CallerClass >::m_instance`[protected]`

Pointer to the object.

Definition at line 112 of file IUpdateManagerSvc.h.

template<class CallerClass>

MemberFunctionType ObjectMemberFunction< CallerClass >::m_memberFunction`[protected]`

Pointer to the member function.

Definition at line 115 of file IUpdateManagerSvc.h.

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

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

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