ATLAS Offline Software
CallBackID.icc
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef SGTOOLS_CALLBACKID_ICC
6 #define SGTOOLS_CALLBACKID_ICC
7 
8 /*****************************************************************************
9  *
10  * CallBackID.h
11  * IOVSvc
12  *
13  * Author: Charles Leggett
14  * $Id: CallBackID.icc,v 1.4 2005-11-08 22:01:30 ssnyder Exp $
15  *
16  * Provides means to identify a callback function.
17  *
18  *****************************************************************************/
19 
20 #include <sstream>
21 #include "GaudiKernel/System.h"
22 
23 template<typename T>
24 void CallBackID::set( StatusCode (T::*updF)(IOVSVC_CALLBACK_ARGS),
25  const T *obj)
26 {
27  union {
28  StatusCode (T::*updF)(IOVSVC_CALLBACK_ARGS);
29  long i;
30  } u;
31  u.updF = updF;
32 
33  p_obj = (void*) obj;
34  m_offset = u.i;
35 
36  std::ostringstream ost;
37  ost << std::hex << "[0x" << (long)p_obj << "]+" << m_offset;
38 
39  m_objName = System::typeinfoName(typeid(*obj));
40  m_name = m_objName + ost.str();
41 
42 }
43 
44 #endif