ATLAS Offline Software
Loading...
Searching...
No Matches
IParticleLinkContainerCnv.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
11
16
17// This classes header
19
20// This is here as a checkreq workaround.
21// The generated pool files depend on EventKernel, but nothing in src does
22// directly. So checkreq was fiving different errors before and after pool
23// generation. By adding an explicit dependency here, those are made
24// consistent.
26
27
28// Create the persistent object from the transient one
30{
31 // Create the message service for this class
32 MsgStream log( msgSvc(), "IParticleLinkContainerConverter" );
33
34 // Do the actual creation of the persistent object
35 IParticleLinkContainer_PERS *persObj = m_TPConverter.createPersistent( transCont, log );
36
37 // Write a debug message out
38 log << MSG::DEBUG << "Success" << endmsg;
39
40 return persObj;
41}
42
43
44// Create the transient object from the persistent one
46{
47 // Create the message service for this class
48 MsgStream log( msgSvc(), "IParticleLinkContainerConverter" );
49
50 // Define the pool IDs
51 static const pool::Guid p1_guid("E82C71AF-AC5C-453B-9A35-FA45A849838E");
52
53 if( compareClassGuid(p1_guid) )
54 {
55 // using unique_ptr ensures deletion of the persistent object
56 std::unique_ptr< IParticleLinkContainer_PERS > col_vect( poolReadObject< IParticleLinkContainer_PERS >() );
57 return m_TPConverter.createTransient( col_vect.get(), log );
58 }
59 else
60 {
61 throw std::runtime_error("Unsupported persistent version of Data Collection");
62 }
63}
64
#define endmsg
This file contains the class definition for the ElementLinkCnv_p3 class.
IParticleLinkContainer_p1 IParticleLinkContainer_PERS
IParticleLinkContainerCnv.h.
IParticleLinkContainerCnv_p1 m_TPConverter
Create the t/p converter.
virtual IParticleLinkContainer * createTransient()
Member method to create the transient version.
virtual IParticleLinkContainer_PERS * createPersistent(IParticleLinkContainer *transCont)
Member method to create the persistent version.