| The Gaudi Framework v32r1 (f65d50dc)

Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
ObjectMemberFunction< CallerClass > Class Template Referencefinal

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

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

## Public Types
typedef StatusCode(CallerClass::* | MemberFunctionType) ()
| MemberFunctionType is the type for a pointer to a member function of class CallerClass. More...

## Public Member Functions
StatusCode | operator() () const override
| Calls the member function of the object and returns the StatusCode. More...
BaseObjectMemberFunction * | makeCopy () const override
| Clone method to be able to copy an ObjectMemberFunction from the BaseObjectMemberFunction interface. More...
const std::type_info & | type () const override
| Returns the type_info of the CallerClass. More...
bool | match (BaseObjectMemberFunction *bmf) const override
| Comparison between two BaseObjectMemberFunction instances. More...
DataObject * | castToDataObject () const override
| Cast the object to DataObject. More...
ValidDataObject * | castToValidDataObject () const override
| Cast the object to ValidDataObject. More...
void * | castToVoid () const override
| Cast the object to void with dynamic_cast. More...
Public Member Functions inherited from BaseObjectMemberFunction
virtual | ~BaseObjectMemberFunction ()=default
| Virtual destructor. More...

## Protected Member Functions
| ObjectMemberFunction (CallerClass *instance, const MemberFunctionType &mf)
| Standard constructor. Protected so that can be called only by itself or IUpdateManagerSvc. More...

## Protected Attributes
CallerClass * | m_instance
| Pointer to the object. More...
MemberFunctionType | m_memberFunction
| Pointer to the member function. More...

## 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 55 of file IUpdateManagerSvc.h.

## Member Typedef Documentation

## ◆ MemberFunctionType

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 58 of file IUpdateManagerSvc.h.

## Constructor & Destructor Documentation

## ◆ ObjectMemberFunction()

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 96 of file IUpdateManagerSvc.h.

97 : m_instance( instance ), m_memberFunction( mf ) {}
ObjectMemberFunction::m_memberFunction
MemberFunctionType m_memberFunction
Pointer to the member function.
Definition: IUpdateManagerSvc.h:103
ObjectMemberFunction::m_instance
CallerClass * m_instance
Pointer to the object.
Definition: IUpdateManagerSvc.h:100

## Member Function Documentation

## ◆ castToDataObject()

template<class CallerClass>

DataObject* ObjectMemberFunction< CallerClass >::castToDataObject | ( |  | ) | const
| inline override virtual

Cast the object to DataObject.

Implements BaseObjectMemberFunction.

Definition at line 86 of file IUpdateManagerSvc.h.

86 { return dynamic_cast<DataObject*>( m_instance ); }
ObjectMemberFunction::m_instance
CallerClass * m_instance
Pointer to the object.
Definition: IUpdateManagerSvc.h:100

## ◆ castToValidDataObject()

template<class CallerClass>

ValidDataObject* ObjectMemberFunction< CallerClass >::castToValidDataObject | ( |  | ) | const
| inline override virtual

Cast the object to ValidDataObject.

Implements BaseObjectMemberFunction.

Definition at line 89 of file IUpdateManagerSvc.h.

89 { return dynamic_cast<ValidDataObject*>( m_instance ); }
ObjectMemberFunction::m_instance
CallerClass * m_instance
Pointer to the object.
Definition: IUpdateManagerSvc.h:100

## ◆ castToVoid()

template<class CallerClass>

void* ObjectMemberFunction< CallerClass >::castToVoid | ( |  | ) | const
| inline override virtual

Cast the object to void with dynamic_cast.

Implements BaseObjectMemberFunction.

Definition at line 92 of file IUpdateManagerSvc.h.

92 { return dynamic_cast<void*>( m_instance ); }
ObjectMemberFunction::m_instance
CallerClass * m_instance
Pointer to the object.
Definition: IUpdateManagerSvc.h:100

## ◆ makeCopy()

template<class CallerClass>

BaseObjectMemberFunction* ObjectMemberFunction< CallerClass >::makeCopy | ( |  | ) | const
| inline override virtual

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

Implements BaseObjectMemberFunction.

Definition at line 68 of file IUpdateManagerSvc.h.

68 {
69 return new ObjectMemberFunction<CallerClass>( m_instance, m_memberFunction );
70 }
ObjectMemberFunction::m_memberFunction
MemberFunctionType m_memberFunction
Pointer to the member function.
Definition: IUpdateManagerSvc.h:103
ObjectMemberFunction::m_instance
CallerClass * m_instance
Pointer to the object.
Definition: IUpdateManagerSvc.h:100
ObjectMemberFunction
This class is used by IUpdateManagerSvc to keep pairs made of a member function and a pointer to the ...
Definition: IUpdateManagerSvc.h:55

## ◆ match()

template<class CallerClass>

bool ObjectMemberFunction< CallerClass >::match | ( | BaseObjectMemberFunction< CallerClass > * | bmf | ) | const
| inline override virtual

Comparison between two BaseObjectMemberFunction instances.

Implements BaseObjectMemberFunction.

Definition at line 76 of file IUpdateManagerSvc.h.

76 {
77 if ( bmf == (BaseObjectMemberFunction*)this ) return true;
78 if ( type() == bmf->type() ) {
79 ObjectMemberFunction* mf = dynamic_cast<ObjectMemberFunction*>( bmf );
80 return m_instance == mf->m_instance && m_memberFunction == mf->m_memberFunction;
81 }
82 return false;
83 }
ObjectMemberFunction::m_memberFunction
MemberFunctionType m_memberFunction
Pointer to the member function.
Definition: IUpdateManagerSvc.h:103
ObjectMemberFunction::m_instance
CallerClass * m_instance
Pointer to the object.
Definition: IUpdateManagerSvc.h:100
BaseObjectMemberFunction::type
virtual const std::type_info & type() const =0
ObjectMemberFunction
This class is used by IUpdateManagerSvc to keep pairs made of a member function and a pointer to the ...
Definition: IUpdateManagerSvc.h:55
ObjectMemberFunction::type
const std::type_info & type() const override
Returns the type_info of the CallerClass.
Definition: IUpdateManagerSvc.h:73
BaseObjectMemberFunction
Base class of ObjectMemberFunction.
Definition: IUpdateManagerSvc.h:29

## ◆ operator()()

template<class CallerClass>

StatusCode ObjectMemberFunction< CallerClass >::operator() | ( |  | ) | const
| inline override virtual

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

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

Implements BaseObjectMemberFunction.

Definition at line 62 of file IUpdateManagerSvc.h.

62 {
63 return m_memberFunction ? ( m_instance->*m_memberFunction )() : StatusCode::SUCCESS;
64 }
ObjectMemberFunction::m_memberFunction
MemberFunctionType m_memberFunction
Pointer to the member function.
Definition: IUpdateManagerSvc.h:103
GaudiPython.Bindings.SUCCESS
SUCCESS
Definition: Bindings.py:56
ObjectMemberFunction::m_instance
CallerClass * m_instance
Pointer to the object.
Definition: IUpdateManagerSvc.h:100
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50

## ◆ type()

template<class CallerClass>

const std::type_info& ObjectMemberFunction< CallerClass >::type | ( |  | ) | const
| inline override virtual

Returns the type_info of the CallerClass.

Implements BaseObjectMemberFunction.

Definition at line 73 of file IUpdateManagerSvc.h.

73 { return typeid( CallerClass ); }

## Friends And Related Function Documentation

## ◆ IUpdateManagerSvc

template<class CallerClass>

friend class IUpdateManagerSvc
| friend

Definition at line 105 of file IUpdateManagerSvc.h.

## Member Data Documentation

## ◆ m_instance

template<class CallerClass>

CallerClass* ObjectMemberFunction< CallerClass >::m_instance
| protected

Pointer to the object.

Definition at line 100 of file IUpdateManagerSvc.h.

## ◆ m_memberFunction

template<class CallerClass>

MemberFunctionType ObjectMemberFunction< CallerClass >::m_memberFunction
| protected

Pointer to the member function.

Definition at line 103 of file IUpdateManagerSvc.h.

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

- GaudiKernel/GaudiKernel/IUpdateManagerSvc.h