1 #ifndef GAUDIKERNEL_IUPDATEMANAGERSVC_H
2 #define GAUDIKERNEL_IUPDATEMANAGERSVC_H 1
10 #include "GaudiKernel/IInterface.h"
14 class ValidDataObject;
18 namespace Gaudi {
class Time; }
36 virtual const std::type_info &
type()
const = 0;
52 template <
class CallerClass>
75 const std::type_info &
type()
const override {
return typeid(CallerClass); }
95 return dynamic_cast<ValidDataObject*
>(
m_instance);
132 virtual bool isNull() = 0;
149 template<
class ActualType>
152 using dest_type = ActualType;
153 PtrSetter(dest_type *&
dest):m_storage(&dest) {
154 *m_storage =
nullptr;
157 *m_storage =
dynamic_cast<dest_type *
>(obj);
159 bool isNull()
override {
return *m_storage ==
nullptr; }
163 dest_type **m_storage;
181 template <
class CallerClass>
182 inline void registerCondition(CallerClass *instance,
const std::string &condition =
"",
187 template <
class CallerClass,
class CondType>
188 inline void registerCondition(CallerClass *instance,
const std::string &condition,
190 CondType *&condPtrDest){
192 new PtrSetter<CondType>(condPtrDest));
196 template <
class CallerClass>
197 inline void registerCondition(CallerClass *instance,
const char *condition,
205 template <
class CallerClass,
class ObjectClass>
206 inline void registerCondition(CallerClass *instance, ObjectClass *obj,
214 template <
class CallerClass>
215 inline void unregister(CallerClass *instance) {
216 i_unregister(dynamic_cast<void*>(instance));
221 template <
class CallerClass>
222 inline void invalidate(CallerClass *instance) {i_invalidate(dynamic_cast<void*>(instance));}
231 virtual void setValidity(
const std::string
path,
233 bool path_to_db =
false) = 0;
244 template <
class CallerClass>
246 return i_update(dynamic_cast<void*>(instance));
250 virtual void dump() = 0;
253 virtual void acquireLock() = 0;
255 virtual void releaseLock() = 0;
260 virtual void purge() = 0;
274 virtual StatusCode i_update(
void *instance) = 0;
275 virtual void i_unregister(
void *instance) = 0;
276 virtual void i_invalidate(
void *instance) = 0;
278 friend class PythonHelper;
280 #endif // GAUDIKERNEL_IUPDATEMANAGERSVC_H
virtual DataObject * castToDataObject() const =0
MemberFunctionType m_memberFunction
Pointer to the member function.
virtual bool isNull()=0
tells if the internal pointer is nullptr.
ValidDataObject * castToValidDataObject() const override
Cast the object to ValidDataObject.
Base class to set the pointer to an object of a class derived from DataObject in a generic way...
virtual void * castToVoid() const =0
CallerClass * m_instance
Pointer to the object.
bool match(BaseObjectMemberFunction *bmf) const override
Comparison between two BaseObjectMemberFunction instances.
BaseObjectMemberFunction * makeCopy() const override
Clone method to be able to copy an ObjectMemberFunction from the BaseObjectMemberFunction interface...
virtual bool match(BaseObjectMemberFunction *) const =0
Data provider interface definition.
virtual BaseObjectMemberFunction * makeCopy() const =0
virtual StatusCode operator()() const =0
#define DeclareInterfaceID(iface, major, minor)
Macro to declare the interface ID when using the new mechanism of extending and implementing interfac...
This class is used for returning status codes from appropriate routines.
Definition of the basic interface.
virtual void set(DataObject *)=0
sets the internal pointer to the provided data object (with a dynamic_cast).
Interface class to the Update Manager service.
virtual const std::type_info & type() const =0
ObjectMemberFunction(CallerClass *instance, const MemberFunctionType &mf)
Standard constructor. Protected so that can be called only by itself or IUpdateManagerSvc.
This class is used by IUpdateManagerSvc to keep pairs made of a member function and a pointer to the ...
virtual ~BasePtrSetter()=default
Empty virtual destructor.
virtual ~BaseObjectMemberFunction()=default
Virtual destructor.
DataObject * castToDataObject() const override
Cast the object to DataObject.
void * castToVoid() const override
Cast the object to void with dynamic_cast.
~ObjectMemberFunction() override=default
Virtual destructor.
A DataObject is the base class of any identifiable object on any data store.
virtual ValidDataObject * castToValidDataObject() const =0
Helper functions to set/get the application return code.
const std::type_info & type() const override
Returns the type_info of the CallerClass.
StatusCode operator()() const override
Calls the member function of the object and returns the StatusCode.
Base class of ObjectMemberFunction.
StatusCode(CallerClass::* MemberFunctionType)()
MemberFunctionType is the type for a pointer to a member function of class CallerClass.