ATLAS Offline Software
TrigSerTPTool.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 
3 /*
4  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 // $Id$
8 #ifndef TRIGSERIALIZETP_TRIGSERTPTOOL_H
9 #define TRIGSERIALIZETP_TRIGSERTPTOOL_H 1
10 
11 // System include(s):
12 #include <string>
13 #include <vector>
14 #include <map>
15 #include <memory>
16 
17 // Gaudi/Athena include(s):
18 #include "GaudiKernel/ServiceHandle.h"
19 #include "GaudiKernel/MsgStream.h"
20 #include "GaudiKernel/IMessageSvc.h"
22 #include "AthenaKernel/ITPCnvSvc.h"
25 #include "CxxUtils/ClassName.h"
26 
32 class TrigSerTPTool : public AthAlgTool {
33 
34 public:
36  static const InterfaceID& interfaceID( ) {
37  static const InterfaceID
38  IID_TrigSerTPTool("TrigSerTPTool", 1, 0);
39  return IID_TrigSerTPTool;
40  }
41 
43  TrigSerTPTool( const std::string& type, const std::string& name,
44  const IInterface* parent );
45 
47  virtual StatusCode initialize() override;
48 
50  void* convertTP( const std::string& transName, void* trans,
51  std::string& persName ) const;
53  void* convertPT( const std::string& persName, void* pers,
54  std::string& transName ) const;
55 
57  const std::string& persClassName( const std::string& transClassName ) const;
58 
59 private:
61  TClass* getClass( const std::string& clname ) const;
63 
64  std::unique_ptr< MsgStream > m_logTP;
65  std::map< std::string, std::string > m_TPmap; //configure - lookup of
66  std::vector< std::string > m_activeClasses;
70  bool m_online;
73  mutable std::map<std::string, ITPCnvBase*> m_convertesCache ATLAS_THREAD_SAFE;
74 
75  ITPCnvBase* getConverter( const std::string& persistent ) const;
76 
77 }; // class TrigSerTPTool
78 
79 #endif // !TRIGSERIALIZETP_TRIGSERTPTOOL_H
python.TriggerEDMRun3.persistent
def persistent(transient)
Definition: TriggerEDMRun3.py:1171
ClassName.h
Recursively separate out template arguments in a C++ class name.
TrigSerTPTool::m_tpcnvsvc
ServiceHandle< ITPCnvSvc > m_tpcnvsvc
Definition: TrigSerTPTool.h:71
TrigSerTPTool::m_TPmap
std::map< std::string, std::string > m_TPmap
Definition: TrigSerTPTool.h:65
ITPCnvSvc.h
BeamSpot::mutex
std::mutex mutex
Definition: InDetBeamSpotVertex.cxx:18
TrigSerTPTool::m_dictSvc
ServiceHandle< IDictLoaderSvc > m_dictSvc
Definition: TrigSerTPTool.h:68
TrigSerTPTool::m_convertersCacheMutex
std::mutex m_convertersCacheMutex
Definition: TrigSerTPTool.h:72
TrigSerTPTool::interfaceID
static const InterfaceID & interfaceID()
Declare the interface provided by the tool.
Definition: TrigSerTPTool.h:36
TrigSerTPTool::persClassName
const std::string & persClassName(const std::string &transClassName) const
Get the name of the persistent class belonging to a transient one.
Definition: TrigSerTPTool.cxx:211
TrigSerTPTool::getConverter
ITPCnvBase * getConverter(const std::string &persistent) const
Definition: TrigSerTPTool.cxx:84
TrigSerTPTool::m_msgsvcTP
ServiceHandle< IMessageSvc > m_msgsvcTP
Definition: TrigSerTPTool.h:67
TrigSerTPTool::m_logTP
std::unique_ptr< MsgStream > m_logTP
Definition: TrigSerTPTool.h:64
TrigSerTPTool::convertTP
void * convertTP(const std::string &transName, void *trans, std::string &persName) const
Convert a transient object to its persistent self.
Definition: TrigSerTPTool.cxx:101
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
TrigSerTPTool::convertPT
void * convertPT(const std::string &persName, void *pers, std::string &transName) const
Convert a persistent object to its transient self.
Definition: TrigSerTPTool.cxx:166
TrigSerTPTool::ATLAS_THREAD_SAFE
std::map< std::string, ITPCnvBase * > m_convertesCache ATLAS_THREAD_SAFE
Definition: TrigSerTPTool.h:73
AthAlgTool.h
test_pyathena.parent
parent
Definition: test_pyathena.py:15
CxxUtils::ClassName::Rules
A set of transformation rules to use with ClassName.
Definition: CxxUtils/CxxUtils/ClassName.h:130
TrigSerTPTool::m_useAthDictLoader
bool m_useAthDictLoader
Definition: TrigSerTPTool.h:69
TrigSerTPTool::TrigSerTPTool
TrigSerTPTool(const std::string &type, const std::string &name, const IInterface *parent)
Standard AlgTool constructor.
Definition: TrigSerTPTool.cxx:21
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
TrigSerTPTool
Definition: TrigSerTPTool.h:32
ITPCnvBase
Definition: ITPCnvBase.h:24
IDictLoaderSvc.h
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
TrigSerTPTool::m_activeClasses
std::vector< std::string > m_activeClasses
Definition: TrigSerTPTool.h:66
TrigSerTPTool::initialize
virtual StatusCode initialize() override
Function initialising the tool.
Definition: TrigSerTPTool.cxx:45
AthAlgTool
Definition: AthAlgTool.h:26
TrigSerTPTool::getClass
TClass * getClass(const std::string &clname) const
Get the ROOT dictionary for a type.
Definition: TrigSerTPTool.cxx:227
TrigSerTPTool::m_clNameRules
CxxUtils::ClassName::Rules m_clNameRules
Definition: TrigSerTPTool.h:62
TrigSerTPTool::m_online
bool m_online
Definition: TrigSerTPTool.h:70
checker_macros.h
Define macros for attributes used to control the static checker.
ServiceHandle< IMessageSvc >