The Gaudi Framework  v30r3 (a5ef0a68)
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 >:
Collaboration diagram for ObjectMemberFunction< CallerClass >:

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...
 
BaseObjectMemberFunctionmakeCopy () const override
 Clone method to be able to copy an ObjectMemberFunction from the BaseObjectMemberFunction interface. More...
 
const std::type_infotype () const override
 Returns the type_info of the CallerClass. More...
 
bool match (BaseObjectMemberFunction *bmf) const override
 Comparison between two BaseObjectMemberFunction instances. More...
 
DataObjectcastToDataObject () 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 ( CallerClass *  instance,
const MemberFunctionType mf 
)
inlineprotected

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

Definition at line 102 of file IUpdateManagerSvc.h.

103  : m_instance( instance ), m_memberFunction( mf )
104  {
105  }
MemberFunctionType m_memberFunction
Pointer to the member function.
CallerClass * m_instance
Pointer to the object.

Member Function Documentation

template<class CallerClass>
DataObject* ObjectMemberFunction< CallerClass >::castToDataObject ( ) const
inlineoverridevirtual

Cast the object to DataObject.

Implements BaseObjectMemberFunction.

Definition at line 92 of file IUpdateManagerSvc.h.

92 { return dynamic_cast<DataObject*>( m_instance ); }
CallerClass * m_instance
Pointer to the object.
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
inlineoverridevirtual

Cast the object to ValidDataObject.

Implements BaseObjectMemberFunction.

Definition at line 95 of file IUpdateManagerSvc.h.

95 { return dynamic_cast<ValidDataObject*>( m_instance ); }
CallerClass * m_instance
Pointer to the object.
template<class CallerClass>
void* ObjectMemberFunction< CallerClass >::castToVoid ( ) const
inlineoverridevirtual

Cast the object to void with dynamic_cast.

Implements BaseObjectMemberFunction.

Definition at line 98 of file IUpdateManagerSvc.h.

98 { return dynamic_cast<void*>( m_instance ); }
CallerClass * m_instance
Pointer to the object.
template<class CallerClass>
BaseObjectMemberFunction* ObjectMemberFunction< CallerClass >::makeCopy ( ) const
inlineoverridevirtual

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

Implements BaseObjectMemberFunction.

Definition at line 72 of file IUpdateManagerSvc.h.

73  {
75  }
MemberFunctionType m_memberFunction
Pointer to the member function.
CallerClass * m_instance
Pointer to the object.
This class is used by IUpdateManagerSvc to keep pairs made of a member function and a pointer to the ...
template<class CallerClass>
bool ObjectMemberFunction< CallerClass >::match ( BaseObjectMemberFunction< CallerClass > *  bmf) const
inlineoverridevirtual

Comparison between two BaseObjectMemberFunction instances.

Implements BaseObjectMemberFunction.

Definition at line 81 of file IUpdateManagerSvc.h.

82  {
83  if ( bmf == (BaseObjectMemberFunction*)this ) return true;
84  if ( type() == bmf->type() ) {
85  ObjectMemberFunction* mf = dynamic_cast<ObjectMemberFunction*>( bmf );
87  }
88  return false;
89  }
MemberFunctionType m_memberFunction
Pointer to the member function.
const std::type_info & type() const override
Returns the type_info of the CallerClass.
CallerClass * m_instance
Pointer to the object.
This class is used by IUpdateManagerSvc to keep pairs made of a member function and a pointer to the ...
virtual const std::type_info & type() const =0
Base class of ObjectMemberFunction.
template<class CallerClass>
StatusCode ObjectMemberFunction< CallerClass >::operator() ( ) const
inlineoverridevirtual

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

66  {
68  }
MemberFunctionType m_memberFunction
Pointer to the member function.
CallerClass * m_instance
Pointer to the object.
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:51
template<class CallerClass>
const std::type_info& ObjectMemberFunction< CallerClass >::type ( ) const
inlineoverridevirtual

Returns the type_info of the CallerClass.

Implements BaseObjectMemberFunction.

Definition at line 78 of file IUpdateManagerSvc.h.

78 { return typeid( CallerClass ); }

Friends And Related Function Documentation

template<class CallerClass>
friend class IUpdateManagerSvc
friend

Definition at line 113 of file IUpdateManagerSvc.h.

Member Data Documentation

template<class CallerClass>
CallerClass* ObjectMemberFunction< CallerClass >::m_instance
protected

Pointer to the object.

Definition at line 108 of file IUpdateManagerSvc.h.

template<class CallerClass>
MemberFunctionType ObjectMemberFunction< CallerClass >::m_memberFunction
protected

Pointer to the member function.

Definition at line 111 of file IUpdateManagerSvc.h.


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