ATLAS Offline Software
CallBackID.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef SGTOOLS_CALLBACKID_H
6 #define SGTOOLS_CALLBACKID_H
7 
8 /*****************************************************************************
9  *
10  * CallBackID.h
11  * IOVSvc
12  *
13  * Author: Charles Leggett
14  * $Id: CallBackID.h,v 1.3 2005-11-08 22:01:30 ssnyder Exp $
15  *
16  * Provides means to identify a callback function.
17  *
18  *****************************************************************************/
19 
20 #ifndef ATHENAKERNEL_IOVSVCDEFS_H
21  #include "AthenaKernel/IOVSvcDefs.h"
22 #endif
23 
24 class CallBackID {
25 public:
26  CallBackID():m_offset(0),p_obj(0){};
27 
28  template<typename T>
29  CallBackID(StatusCode (T::*updF)(IOVSVC_CALLBACK_ARGS), const T *obj) {
30  set(updF,obj);
31  }
32 
33  template<typename T>
34  void set(StatusCode (T::*updF)(IOVSVC_CALLBACK_ARGS), const T *obj);
35 
36  const std::string& name() const { return m_name; }
37  const std::string& objName() const { return m_objName; }
38  int offset() const { return m_offset; }
39  const void* ptr() const { return p_obj; }
40 
41  bool operator==(const CallBackID& cb) const {
42  return ( cb.m_offset == m_offset && cb.p_obj == p_obj );
43  }
44  bool operator<(const CallBackID& cb) const {
45  if ( p_obj != cb.p_obj ) {
46  return ( p_obj < cb.p_obj ) ;
47  } else {
48  return ( m_offset < cb.m_offset );
49  }
50  }
51 
52 private:
53  long m_offset;
54  const void* p_obj;
55 
56  std::string m_name;
57  std::string m_objName;
58 
59 };
60 
61 #ifndef SGTOOLS_CALLBACKID_ICC
62  #include "SGTools/CallBackID.icc"
63 #endif
64 
65 #endif
CallBackID
Definition: CallBackID.h:24
CallBackID::set
void set(StatusCode(T::*updF)(IOVSVC_CALLBACK_ARGS), const T *obj)
CallBackID::m_name
std::string m_name
Definition: CallBackID.h:66
CallBackID::CallBackID
CallBackID()
Definition: CallBackID.h:36
IOVSVC_CALLBACK_ARGS
#define IOVSVC_CALLBACK_ARGS
short hand for IOVSvc call back argument list, to be used when no access to formal arguments is neede...
Definition: IOVSvcDefs.h:24
CallBackID::m_offset
long m_offset
Definition: CallBackID.h:63
CallBackID::ptr
const void * ptr() const
Definition: CallBackID.h:49
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
CallBackID::p_obj
const void * p_obj
Definition: CallBackID.h:64
CallBackID::m_objName
std::string m_objName
Definition: CallBackID.h:67
CallBackID::offset
int offset() const
Definition: CallBackID.h:48
CallBackID::operator==
bool operator==(const CallBackID &cb) const
Definition: CallBackID.h:51
CallBackID::name
const std::string & name() const
Definition: CallBackID.h:46
CallBackID::operator<
bool operator<(const CallBackID &cb) const
Definition: CallBackID.h:54
CallBackID.icc
IOVSvcDefs.h
defines and typedefs for IOVSvc
CallBackID::objName
const std::string & objName() const
Definition: CallBackID.h:47
python.PyAthena.obj
obj
Definition: PyAthena.py:132
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35