| # Gaudi Framework, version v21r7 |

Home |  | Generated: 22 Jan 2010

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

## Constructor & Destructor Documentation

template<class CallerClass>

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

Virtual destructor.

Definition at line 60 of file IUpdateManagerSvc.h.

    00060 {};

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.

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

## Member Function Documentation

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.

    00064                                          {
    00065     return (m_memberFunction != NULL)?
    00066       (m_instance->*m_memberFunction)() :
    00067       StatusCode::SUCCESS;
    00068   }

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.

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

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.

    00077 { return typeid(CallerClass); }

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.

    00080                                                           {
    00081     if ( bmf == (BaseObjectMemberFunction *)this ) return true;
    00082     if (type() == bmf->type()) {
    00083       ObjectMemberFunction * mf = dynamic_cast<ObjectMemberFunction *>(bmf);
    00084       return m_instance == mf->m_instance &&
    00085         m_memberFunction == mf->m_memberFunction;
    00086     }
    00087     return false;
    00088   }

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.

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

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.

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

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.

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

## 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_v21r7/GaudiKernel/GaudiKernel/IUpdateManagerSvc.h