| The Gaudi Framework v27r1

- 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 53 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 56 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 106 of file IUpdateManagerSvc.h.

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

## Member Function Documentation

template<class CallerClass>

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

Cast the object to DataObject.

Implements BaseObjectMemberFunction.

Definition at line 89 of file IUpdateManagerSvc.h.

89 {
90 return dynamic_cast<DataObject*>(m_instance);
91 }
ObjectMemberFunction::m_instance
CallerClass * m_instance
Pointer to the object.
Definition: IUpdateManagerSvc.h:110
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 94 of file IUpdateManagerSvc.h.

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

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

Cast the object to void with dynamic_cast.

Implements BaseObjectMemberFunction.

Definition at line 99 of file IUpdateManagerSvc.h.

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

70 {
71 return new ObjectMemberFunction<CallerClass>(m_instance,m_memberFunction);
72 }
ObjectMemberFunction::m_memberFunction
MemberFunctionType m_memberFunction
Pointer to the member function.
Definition: IUpdateManagerSvc.h:113
ObjectMemberFunction::m_instance
CallerClass * m_instance
Pointer to the object.
Definition: IUpdateManagerSvc.h:110
ObjectMemberFunction
This class is used by IUpdateManagerSvc to keep pairs made of a member function and a pointer to the ...
Definition: IUpdateManagerSvc.h:53
template<class CallerClass>

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

Comparison between two BaseObjectMemberFunction instances.

Implements BaseObjectMemberFunction.

Definition at line 78 of file IUpdateManagerSvc.h.

78 {
79 if ( bmf == (BaseObjectMemberFunction *)this ) return true;
80 if (type() == bmf->type()) {
81 ObjectMemberFunction * mf = dynamic_cast<ObjectMemberFunction *>(bmf);
82 return m_instance == mf->m_instance &&
83 m_memberFunction == mf->m_memberFunction;
84 }
85 return false;
86 }
ObjectMemberFunction::m_memberFunction
MemberFunctionType m_memberFunction
Pointer to the member function.
Definition: IUpdateManagerSvc.h:113
ObjectMemberFunction::m_instance
CallerClass * m_instance
Pointer to the object.
Definition: IUpdateManagerSvc.h:110
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:53
ObjectMemberFunction::type
const std::type_info & type() const override
Returns the type_info of the CallerClass.
Definition: IUpdateManagerSvc.h:75
BaseObjectMemberFunction
Base class of ObjectMemberFunction.
Definition: IUpdateManagerSvc.h:27
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 63 of file IUpdateManagerSvc.h.

63 {
64 return m_memberFunction? (m_instance->*m_memberFunction)()
65 : StatusCode::SUCCESS;
66 }
ObjectMemberFunction::m_memberFunction
MemberFunctionType m_memberFunction
Pointer to the member function.
Definition: IUpdateManagerSvc.h:113
ObjectMemberFunction::m_instance
CallerClass * m_instance
Pointer to the object.
Definition: IUpdateManagerSvc.h:110
GaudiPython.Bindings.SUCCESS
tuple SUCCESS
Definition: Bindings.py:51
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 75 of file IUpdateManagerSvc.h.

75 { return typeid(CallerClass); }

## Friends And Related Function Documentation

template<class CallerClass>

friend class IUpdateManagerSvc
| friend

Definition at line 115 of file IUpdateManagerSvc.h.

## Member Data Documentation

template<class CallerClass>

CallerClass* ObjectMemberFunction< CallerClass >::m_instance
| protected

Pointer to the object.

Definition at line 110 of file IUpdateManagerSvc.h.

template<class CallerClass>

MemberFunctionType ObjectMemberFunction< CallerClass >::m_memberFunction
| protected

Pointer to the member function.

Definition at line 113 of file IUpdateManagerSvc.h.

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

- GaudiKernel/GaudiKernel/IUpdateManagerSvc.h