The Gaudi Framework  master (37c0b60a)
ObjectMemberFunction< CallerClass > Class Template Referencefinal

#include </builds/gaudi/Gaudi/GaudiKernel/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 65 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 68 of file IUpdateManagerSvc.h.

Constructor & Destructor Documentation

◆ ObjectMemberFunction()

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

107  : m_instance( instance ), m_memberFunction( mf ) {}

Member Function Documentation

◆ castToDataObject()

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

Cast the object to DataObject.

Implements BaseObjectMemberFunction.

Definition at line 96 of file IUpdateManagerSvc.h.

96 { return dynamic_cast<DataObject*>( m_instance ); }

◆ castToValidDataObject()

template<class CallerClass >
ValidDataObject* ObjectMemberFunction< CallerClass >::castToValidDataObject ( ) const
inlineoverridevirtual

Cast the object to ValidDataObject.

Implements BaseObjectMemberFunction.

Definition at line 99 of file IUpdateManagerSvc.h.

99 { return dynamic_cast<ValidDataObject*>( m_instance ); }

◆ castToVoid()

template<class CallerClass >
void* ObjectMemberFunction< CallerClass >::castToVoid ( ) const
inlineoverridevirtual

Cast the object to void with dynamic_cast.

Implements BaseObjectMemberFunction.

Definition at line 102 of file IUpdateManagerSvc.h.

102 { return dynamic_cast<void*>( m_instance ); }

◆ makeCopy()

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

78  {
80  }

◆ match()

template<class CallerClass >
bool ObjectMemberFunction< CallerClass >::match ( BaseObjectMemberFunction< CallerClass > *  bmf) const
inlineoverridevirtual

Comparison between two BaseObjectMemberFunction instances.

Implements BaseObjectMemberFunction.

Definition at line 86 of file IUpdateManagerSvc.h.

86  {
87  if ( bmf == (BaseObjectMemberFunction*)this ) return true;
88  if ( type() == bmf->type() ) {
89  ObjectMemberFunction* mf = dynamic_cast<ObjectMemberFunction*>( bmf );
91  }
92  return false;
93  }

◆ operator()()

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

72  {
74  }

◆ type()

template<class CallerClass >
const std::type_info& ObjectMemberFunction< CallerClass >::type ( ) const
inlineoverridevirtual

Returns the type_info of the CallerClass.

Implements BaseObjectMemberFunction.

Definition at line 83 of file IUpdateManagerSvc.h.

83 { return typeid( CallerClass ); }

Friends And Related Function Documentation

◆ IUpdateManagerSvc

template<class CallerClass >
friend class IUpdateManagerSvc
friend

Definition at line 115 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 110 of file IUpdateManagerSvc.h.

◆ m_memberFunction

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:
ObjectMemberFunction::m_memberFunction
MemberFunctionType m_memberFunction
Pointer to the member function.
Definition: IUpdateManagerSvc.h:113
BaseObjectMemberFunction
Definition: IUpdateManagerSvc.h:39
BaseObjectMemberFunction::type
virtual const std::type_info & type() const =0
ObjectMemberFunction::m_instance
CallerClass * m_instance
Pointer to the object.
Definition: IUpdateManagerSvc.h:110
StatusCode
Definition: StatusCode.h:65
GaudiPython.Bindings.SUCCESS
SUCCESS
Definition: Bindings.py:83
ObjectMemberFunction
Definition: IUpdateManagerSvc.h:65
DataObject
Definition: DataObject.h:36
ObjectMemberFunction::type
const std::type_info & type() const override
Returns the type_info of the CallerClass.
Definition: IUpdateManagerSvc.h:83