ATLAS Offline Software
Loading...
Searching...
No Matches
D3PD::RootReaderD3PDSvc Class Reference

A very simple D3PDSvc which produces RootReaderD3PD objects. More...

#include <RootReaderD3PDSvc.h>

Inheritance diagram for D3PD::RootReaderD3PDSvc:
Collaboration diagram for D3PD::RootReaderD3PDSvc:

Public Member Functions

 RootReaderD3PDSvc (const std::string &name, ISvcLocator *svcloc)
 Standard Service constructor.
virtual StatusCode initialize () override
 Standatd Gaudi initialization function.
virtual StatusCode finalize () override
 Standard Gaudi finalization function.
virtual StatusCode make (const std::string &name, ID3PD *&d3pd) override
 Function implementing the ID3PDSvc interface.

Private Attributes

std::vector< ID3PD * > m_d3pds
 Internal list of all the created D3PD objects.
int m_version
 D3PDReader version to use.

Detailed Description

A very simple D3PDSvc which produces RootReaderD3PD objects.

   This service can be used to create RootReaderD3PD objects, and
   generate C++ D3PDReader classes using D3PD::ReaderAlg. It should
   not be used with D3PD::MakerAlg, as the created RootReaderD3PD
   objects do not implement the full D3PD::ID3PD interface. (The job
   will fail...)
Author
Attila Krasznahorkay Attil.nosp@m.a.Kr.nosp@m.aszna.nosp@m.hork.nosp@m.ay@ce.nosp@m.rn.c.nosp@m.h

Definition at line 33 of file RootReaderD3PDSvc.h.

Constructor & Destructor Documentation

◆ RootReaderD3PDSvc()

D3PD::RootReaderD3PDSvc::RootReaderD3PDSvc ( const std::string & name,
ISvcLocator * svcloc )

Standard Service constructor.

Definition at line 16 of file RootReaderD3PDSvc.cxx.

17 : base_class( name, svcloc ) {
18
19 declareProperty( "Version", m_version = 2,
20 "Version of the D3PDReader code to be generated" );
21 }
int m_version
D3PDReader version to use.

Member Function Documentation

◆ finalize()

StatusCode D3PD::RootReaderD3PDSvc::finalize ( )
overridevirtual

Standard Gaudi finalization function.

Definition at line 36 of file RootReaderD3PDSvc.cxx.

36 {
37
38 // Delete all the D3PD objects from memory:
39 std::vector< ID3PD* >::iterator itr = m_d3pds.begin();
40 std::vector< ID3PD* >::iterator end = m_d3pds.end();
41 for( ; itr != end; ++itr ) {
42 delete ( *itr );
43 }
44 m_d3pds.clear();
45
46 return StatusCode::SUCCESS;
47 }
std::vector< ID3PD * > m_d3pds
Internal list of all the created D3PD objects.

◆ initialize()

StatusCode D3PD::RootReaderD3PDSvc::initialize ( )
overridevirtual

Standatd Gaudi initialization function.

Definition at line 23 of file RootReaderD3PDSvc.cxx.

23 {
24
25 if( ( m_version < 1 ) || ( m_version > 2 ) ) {
26 REPORT_MESSAGE( MSG::ERROR ) << "D3PDReader version " << m_version
27 << " not known";
28 return StatusCode::FAILURE;
29 }
30
31 ATH_MSG_INFO( "Generating sources of version: " << m_version );
32
33 return StatusCode::SUCCESS;
34 }
#define ATH_MSG_INFO(x)
#define REPORT_MESSAGE(LVL)
Report a message.

◆ make()

StatusCode D3PD::RootReaderD3PDSvc::make ( const std::string & name,
ID3PD *& d3pd )
overridevirtual

Function implementing the ID3PDSvc interface.

Definition at line 49 of file RootReaderD3PDSvc.cxx.

49 {
50
51 // Create a new D3PD:
52 ID3PD* d = 0;
53 switch( m_version ) {
54 case 1:
55 REPORT_MESSAGE( MSG::VERBOSE ) << "Creating RootReaderD3PD_v1 with name: "
56 << name;
57 d = new RootReaderD3PD_v1();
58 break;
59 case 2:
60 REPORT_MESSAGE( MSG::VERBOSE ) << "Creating RootReaderD3PD_v2 with name: "
61 << name;
62 d = new RootReaderD3PD_v2();
63 break;
64 default:
65 REPORT_MESSAGE( MSG::ERROR ) << "Version number not recognised!";
66 return StatusCode::FAILURE;
67 break;
68 }
69
70 m_d3pds.push_back( d );
71 d3pd = d;
72
73 // This function can actually never fail...
74 return StatusCode::SUCCESS;
75 }

Member Data Documentation

◆ m_d3pds

std::vector< ID3PD* > D3PD::RootReaderD3PDSvc::m_d3pds
private

Internal list of all the created D3PD objects.

Definition at line 49 of file RootReaderD3PDSvc.h.

◆ m_version

int D3PD::RootReaderD3PDSvc::m_version
private

D3PDReader version to use.

Definition at line 52 of file RootReaderD3PDSvc.h.


The documentation for this class was generated from the following files: