1 #ifndef GAUDIKERNEL_IUPDATEMANAGERSVC_H 2 #define GAUDIKERNEL_IUPDATEMANAGERSVC_H 1 14 class ValidDataObject;
44 virtual DataObject* castToDataObject()
const = 0;
45 virtual ValidDataObject* castToValidDataObject()
const = 0;
46 virtual void* castToVoid()
const = 0;
56 template <
class CallerClass>
61 typedef StatusCode ( CallerClass::*MemberFunctionType )();
98 ValidDataObject*
castToValidDataObject()
const override {
return dynamic_cast<ValidDataObject*
>( m_instance ); }
101 void*
castToVoid()
const override {
return dynamic_cast<void*
>( m_instance ); }
106 : m_instance( instance ), m_memberFunction( mf )
134 virtual bool isNull() = 0;
151 template <
class ActualType>
158 bool isNull()
override {
return *m_storage ==
nullptr; }
181 template <
class CallerClass>
188 template <
class CallerClass,
class CondType>
191 CondType*& condPtrDest )
198 template <
class CallerClass>
208 template <
class CallerClass,
class ObjectClass>
218 template <
class CallerClass>
221 i_unregister( dynamic_cast<void*>( instance ) );
226 template <
class CallerClass>
229 i_invalidate( dynamic_cast<void*>( instance ) );
235 bool path_to_db =
false ) = 0;
242 bool path_to_db =
false ) = 0;
253 template <
class CallerClass>
256 return i_update( dynamic_cast<void*>( instance ) );
260 virtual void dump() = 0;
263 virtual void acquireLock() = 0;
265 virtual void releaseLock() = 0;
270 virtual void purge() = 0;
283 virtual StatusCode i_update(
void* instance ) = 0;
284 virtual void i_unregister(
void* instance ) = 0;
285 virtual void i_invalidate(
void* instance ) = 0;
289 #endif // GAUDIKERNEL_IUPDATEMANAGERSVC_H PtrSetter(dest_type *&dest)
MemberFunctionType m_memberFunction
Pointer to the member function.
Base class to set the pointer to an object of a class derived from DataObject in a generic way...
const std::type_info & type() const override
Returns the type_info of the CallerClass.
void invalidate(CallerClass *instance)
Invalidate the given object in the dependency network.
Templated specialization of BasePtrSetter.
bool isNull() override
tells if the internal pointer is nullptr.
ValidDataObject * castToValidDataObject() const override
Cast the object to ValidDataObject.
void unregister(CallerClass *instance)
Generic objects can be unregistered from the UpdateManagerSvc.
Data provider interface definition.
void registerCondition(CallerClass *instance, ObjectClass *obj, typename ObjectMemberFunction< CallerClass >::MemberFunctionType mf=nullptr)
Like the first version of registerCondition, but instead declaring the dependency on a condition of t...
void * castToVoid() const override
Cast the object to void with dynamic_cast.
BaseObjectMemberFunction * makeCopy() const override
Clone method to be able to copy an ObjectMemberFunction from the BaseObjectMemberFunction interface...
CallerClass * m_instance
Pointer to the object.
StatusCode operator()() const override
Calls the member function of the object and returns the StatusCode.
void registerCondition(CallerClass *instance, const std::string &condition, typename ObjectMemberFunction< CallerClass >::MemberFunctionType mf, CondType *&condPtrDest)
This class is used for returning status codes from appropriate routines.
#define DeclareInterfaceID(iface, major, minor)
Macro to declare the interface ID when using the new mechanism of extending and implementing interfac...
Definition of the basic interface.
Helper class implemented in the python dictionary to allow access from python to template member func...
void registerCondition(CallerClass *instance, const std::string &condition="", typename ObjectMemberFunction< CallerClass >::MemberFunctionType mf=nullptr)
Register an object (algorithm instance) to the service.
Interface class to the Update Manager service.
dest_type ** m_storage
pointer to the pointer to fill provided by the user.
StatusCode update(CallerClass *instance)
Update the given instance.
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 Out operator()(const vector_of_const_< In > &inputs) const =0
DataObject * castToDataObject() const override
Cast the object to DataObject.
A DataObject is the base class of any identifiable object on any data store.
virtual const std::type_info & type() const =0
Helper functions to set/get the application return code.
bool match(BaseObjectMemberFunction *bmf) const override
Comparison between two BaseObjectMemberFunction instances.
void registerCondition(CallerClass *instance, const char *condition, typename ObjectMemberFunction< CallerClass >::MemberFunctionType mf=nullptr)
See above. Needed to avoid conflicts with the next one.
Base class of ObjectMemberFunction.