ATLAS Offline Software
Loading...
Searching...
No Matches
AthTPCnvSvc.h
Go to the documentation of this file.
1
2
3/*
4 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
5*/
6
7// AthTPCnvSvc.h
8// Header file for class AthTPCnvSvc
9// Author: S.Binet<binet@cern.ch>
11#ifndef ATHENASERVICES_ATHTPCNVSVC_H
12#define ATHENASERVICES_ATHTPCNVSVC_H 1
13
14// STL includes
15#include <string>
16#include <vector>
17#include <mutex>
18
19// FrameWork includes
20#include "GaudiKernel/ServiceHandle.h"
21#include "GaudiKernel/IClassIDSvc.h"
25
26// Forward declaration
27class ICLIDSvc;
28
29
31 : public extends<AthService, ITPCnvSvc>
32{
33 public:
34
35 // Copy constructor:
36
38 AthTPCnvSvc( const std::string& name, ISvcLocator* pSvcLocator );
39
41 virtual ~AthTPCnvSvc() override;
42
44
46 // Const methods:
48
53 virtual
55 load_tpcnv(const std::string& cls) override;
56
60 virtual
62 t2p_cnv(const std::string& transClassName,
64
68 virtual
70 t2p_cnv(const CLID& transClid,
72
76 virtual
78 p2t_cnv(const std::string& persClassName,
80
84 virtual
85 std::unique_ptr<ITPCnvBase>
86 t2p_cnv_unique(const std::string& transClassName) const override;
87
92 virtual
93 std::unique_ptr<ITPCnvBase>
94 t2p_cnv_unique(const CLID transClid) const override;
95
96
98 // Private data:
100 private:
103
107
108 typedef std::vector<std::unique_ptr<ITPCnvBase> > TpCnvs_t;
112
113 // Protect access to m_cnvs.
114 mutable std::mutex m_mutex;
115};
116
117
118#endif //> !ATHENASERVICES_ATHTPCNVSVC_H
uint32_t CLID
The Class ID type.
AthTPCnvSvc()
Default constructor:
virtual ~AthTPCnvSvc() override
Destructor:
virtual ITPCnvBase * load_tpcnv(const std::string &cls) override
load the T/P converter class named cls return NULL on failure.
ServiceHandle< IClassIDSvc > m_clidSvc
handle to a IClassIDSvc to handle loading of types by CLID
virtual ITPCnvBase * p2t_cnv(const std::string &persClassName, Athena::TPCnvType::Value type=Athena::TPCnvType::Athena) override
return the T/P converter for a persistent class (NULL if failure) ITPCnvSvc owns the ITPCnvBase point...
virtual ITPCnvBase * t2p_cnv(const std::string &transClassName, Athena::TPCnvType::Value type=Athena::TPCnvType::Athena) override
return the T/P converter for a transient class (NULL if failure) ITPCnvSvc owns the ITPCnvBase pointe...
std::mutex m_mutex
TpCnvs_t m_cnvs
a registry of ITPCnvBase* instances
virtual std::unique_ptr< ITPCnvBase > t2p_cnv_unique(const std::string &transClassName) const override
return the T/P converter for a transient class (NULL if failure) Ownership is returned to the caller.
AthTPCnvSvc(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
std::vector< std::unique_ptr< ITPCnvBase > > TpCnvs_t