All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ObjectMemberFunction< CallerClass > Class Template Reference

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

virtual ~ObjectMemberFunction ()
 Virtual destructor. More...
 
virtual StatusCode operator() () const
 Calls the member function of the object and returns the StatusCode. More...
 
virtual BaseObjectMemberFunctionmakeCopy () const
 Clone method to be able to copy an ObjectMemberFunction from the BaseObjectMemberFunction interface. More...
 
virtual const std::type_info & type () const
 Returns the type_info of the CallerClass. More...
 
virtual bool match (BaseObjectMemberFunction *bmf) const
 Comparison between two BaseObjectMemberFunction instances. More...
 
virtual DataObjectcastToDataObject () const
 Cast the object to DataObject. More...
 
virtual ValidDataObject * castToValidDataObject () const
 Cast the object to ValidDataObject. More...
 
virtual void * castToVoid () const
 Cast the object to void with dynamic_cast. More...
 
- Public Member Functions inherited from BaseObjectMemberFunction
virtual ~BaseObjectMemberFunction ()
 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 54 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 57 of file IUpdateManagerSvc.h.

Constructor & Destructor Documentation

template<class CallerClass>
virtual ObjectMemberFunction< CallerClass >::~ObjectMemberFunction ( )
inlinevirtual

Virtual destructor.

Definition at line 60 of file IUpdateManagerSvc.h.

60 {};
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 108 of file IUpdateManagerSvc.h.

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

Member Function Documentation

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

Cast the object to DataObject.

Implements BaseObjectMemberFunction.

Definition at line 91 of file IUpdateManagerSvc.h.

91  {
92  return dynamic_cast<DataObject*>(m_instance);
93  }
CallerClass * m_instance
Pointer to the object.
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:31
template<class CallerClass>
virtual ValidDataObject* ObjectMemberFunction< CallerClass >::castToValidDataObject ( ) const
inlinevirtual

Cast the object to ValidDataObject.

Implements BaseObjectMemberFunction.

Definition at line 96 of file IUpdateManagerSvc.h.

96  {
97  return dynamic_cast<ValidDataObject*>(m_instance);
98  }
CallerClass * m_instance
Pointer to the object.
template<class CallerClass>
virtual void* ObjectMemberFunction< CallerClass >::castToVoid ( ) const
inlinevirtual

Cast the object to void with dynamic_cast.

Implements BaseObjectMemberFunction.

Definition at line 101 of file IUpdateManagerSvc.h.

101  {
102  return dynamic_cast<void*>(m_instance);
103  }
CallerClass * m_instance
Pointer to the object.
template<class CallerClass>
virtual BaseObjectMemberFunction* ObjectMemberFunction< CallerClass >::makeCopy ( ) const
inlinevirtual

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

Implements BaseObjectMemberFunction.

Definition at line 72 of file IUpdateManagerSvc.h.

72  {
74  }
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>
virtual bool ObjectMemberFunction< CallerClass >::match ( BaseObjectMemberFunction< CallerClass > *  bmf) const
inlinevirtual

Comparison between two BaseObjectMemberFunction instances.

Implements BaseObjectMemberFunction.

Definition at line 80 of file IUpdateManagerSvc.h.

80  {
81  if ( bmf == (BaseObjectMemberFunction *)this ) return true;
82  if (type() == bmf->type()) {
83  ObjectMemberFunction * mf = dynamic_cast<ObjectMemberFunction *>(bmf);
84  return m_instance == mf->m_instance &&
86  }
87  return false;
88  }
MemberFunctionType m_memberFunction
Pointer to the member function.
CallerClass * m_instance
Pointer to the object.
virtual const std::type_info & type() const =0
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
Returns the type_info of the CallerClass.
Base class of ObjectMemberFunction.
template<class CallerClass>
virtual StatusCode ObjectMemberFunction< CallerClass >::operator() ( ) const
inlinevirtual

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

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

Implements BaseObjectMemberFunction.

Definition at line 64 of file IUpdateManagerSvc.h.

64  {
65  return (m_memberFunction != NULL)?
68  }
MemberFunctionType m_memberFunction
Pointer to the member function.
CallerClass * m_instance
Pointer to the object.
template<class CallerClass>
virtual const std::type_info& ObjectMemberFunction< CallerClass >::type ( ) const
inlinevirtual

Returns the type_info of the CallerClass.

Implements BaseObjectMemberFunction.

Definition at line 77 of file IUpdateManagerSvc.h.

77 { return typeid(CallerClass); }

Friends And Related Function Documentation

template<class CallerClass>
friend class IUpdateManagerSvc
friend

Definition at line 117 of file IUpdateManagerSvc.h.

Member Data Documentation

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

Pointer to the object.

Definition at line 112 of file IUpdateManagerSvc.h.

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

Pointer to the member function.

Definition at line 115 of file IUpdateManagerSvc.h.


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