| The Gaudi Framework v30r0 (c919700c)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

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
| ~ObjectMemberFunction () override=default
| Virtual destructor. More...
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 57 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 61 of file IUpdateManagerSvc.h.

## Constructor & Destructor Documentation

template<class CallerClass>

ObjectMemberFunction< CallerClass >::~ObjectMemberFunction | ( |  | ) |
| override default

Virtual destructor.

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

106 : m_instance( instance ), m_memberFunction( mf )
107 {
108 }
ObjectMemberFunction::m_memberFunction
MemberFunctionType m_memberFunction
Pointer to the member function.
Definition: IUpdateManagerSvc.h:114
ObjectMemberFunction::m_instance
CallerClass * m_instance
Pointer to the object.
Definition: IUpdateManagerSvc.h:111

## Member Function Documentation

template<class CallerClass>

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

Cast the object to DataObject.

Implements BaseObjectMemberFunction.

Definition at line 95 of file IUpdateManagerSvc.h.

95 { return dynamic_cast<DataObject*>( m_instance ); }
ObjectMemberFunction::m_instance
CallerClass * m_instance
Pointer to the object.
Definition: IUpdateManagerSvc.h:111
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
template<class CallerClass>

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

Cast the object to ValidDataObject.

Implements BaseObjectMemberFunction.

Definition at line 98 of file IUpdateManagerSvc.h.

98 { return dynamic_cast<ValidDataObject*>( m_instance ); }
ObjectMemberFunction::m_instance
CallerClass * m_instance
Pointer to the object.
Definition: IUpdateManagerSvc.h:111
template<class CallerClass>

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

Cast the object to void with dynamic_cast.

Implements BaseObjectMemberFunction.

Definition at line 101 of file IUpdateManagerSvc.h.

101 { return dynamic_cast<void*>( m_instance ); }
ObjectMemberFunction::m_instance
CallerClass * m_instance
Pointer to the object.
Definition: IUpdateManagerSvc.h:111
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 75 of file IUpdateManagerSvc.h.

76 {
77 return new ObjectMemberFunction<CallerClass>( m_instance, m_memberFunction );
78 }
ObjectMemberFunction::m_memberFunction
MemberFunctionType m_memberFunction
Pointer to the member function.
Definition: IUpdateManagerSvc.h:114
ObjectMemberFunction::m_instance
CallerClass * m_instance
Pointer to the object.
Definition: IUpdateManagerSvc.h:111
ObjectMemberFunction
This class is used by IUpdateManagerSvc to keep pairs made of a member function and a pointer to the ...
Definition: IUpdateManagerSvc.h:57
template<class CallerClass>

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

Comparison between two BaseObjectMemberFunction instances.

Implements BaseObjectMemberFunction.

Definition at line 84 of file IUpdateManagerSvc.h.

85 {
86 if ( bmf == (BaseObjectMemberFunction*)this ) return true;
87 if ( type() == bmf->type() ) {
88 ObjectMemberFunction* mf = dynamic_cast<ObjectMemberFunction*>( bmf );
89 return m_instance == mf->m_instance && m_memberFunction == mf->m_memberFunction;
90 }
91 return false;
92 }
ObjectMemberFunction::m_memberFunction
MemberFunctionType m_memberFunction
Pointer to the member function.
Definition: IUpdateManagerSvc.h:114
ObjectMemberFunction::type
const std::type_info & type() const override
Returns the type_info of the CallerClass.
Definition: IUpdateManagerSvc.h:81
ObjectMemberFunction::m_instance
CallerClass * m_instance
Pointer to the object.
Definition: IUpdateManagerSvc.h:111
ObjectMemberFunction
This class is used by IUpdateManagerSvc to keep pairs made of a member function and a pointer to the ...
Definition: IUpdateManagerSvc.h:57
BaseObjectMemberFunction::type
virtual const std::type_info & type() const =0
BaseObjectMemberFunction
Base class of ObjectMemberFunction.
Definition: IUpdateManagerSvc.h:30
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 68 of file IUpdateManagerSvc.h.

69 {
70 return m_memberFunction ? ( m_instance->*m_memberFunction )() : StatusCode::SUCCESS;
71 }
ObjectMemberFunction::m_memberFunction
MemberFunctionType m_memberFunction
Pointer to the member function.
Definition: IUpdateManagerSvc.h:114
GaudiPython.Bindings.SUCCESS
SUCCESS
Definition: Bindings.py:56
ObjectMemberFunction::m_instance
CallerClass * m_instance
Pointer to the object.
Definition: IUpdateManagerSvc.h:111
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
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 81 of file IUpdateManagerSvc.h.

81 { return typeid( CallerClass ); }

## Friends And Related Function Documentation

template<class CallerClass>

friend class IUpdateManagerSvc
| friend

Definition at line 116 of file IUpdateManagerSvc.h.

## Member Data Documentation

template<class CallerClass>

CallerClass* ObjectMemberFunction< CallerClass >::m_instance
| protected

Pointer to the object.

Definition at line 111 of file IUpdateManagerSvc.h.

template<class CallerClass>

MemberFunctionType ObjectMemberFunction< CallerClass >::m_memberFunction
| protected

Pointer to the member function.

Definition at line 114 of file IUpdateManagerSvc.h.

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

- GaudiKernel/GaudiKernel/IUpdateManagerSvc.h