ATLAS Offline Software
Public Member Functions | Protected Attributes | List of all members
ByteStreamCnvSvcBase Class Reference

The base class for offline and HLT ByteStream conversion services. More...

#include <ByteStreamCnvSvcBase.h>

Inheritance diagram for ByteStreamCnvSvcBase:
Collaboration diagram for ByteStreamCnvSvcBase:

Public Member Functions

 ByteStreamCnvSvcBase (const std::string &name, ISvcLocator *pSvcLocator)
 Standard Service Constructor. More...
 
virtual ~ByteStreamCnvSvcBase ()
 Destructor. More...
 
virtual StatusCode initialize () override
 Required of all Gaudi Services. More...
 
virtual StatusCode updateServiceState (IOpaqueAddress *pAddress) override
 Checks whether an IOpaqueAddress is a GenericAddress. More...
 
virtual void handle (const Incident &) override
 Implementation of IIncidentListener: Handle for EndEvent incidence. More...
 

Protected Attributes

Gaudi::Property< std::vector< std::string > > m_initCnvs {this, "InitCnvs", {}, "Converters to initialize"}
 
Gaudi::Property< std::vector< std::string > > m_ROD2ROBmap {this, "ROD2ROBmap", {}, "", "OrderedSet<std::string>"}
 

Private Attributes

Flags which are not used by this service.

It only serves as an entity storing these values and some other components read it from here.

TODO: Remove this solution and move the properties where they are needed.

Gaudi::Property< bool > m_isSimulation {this, "IsSimulation", false}
 
Gaudi::Property< bool > m_isTestbeam {this, "IsTestbeam", false}
 flags for TestBeam EventType More...
 
Gaudi::Property< bool > m_isCalibration {this, "IsCalibration", false}
 flags for Calibration EventType More...
 

Detailed Description

The base class for offline and HLT ByteStream conversion services.

Definition at line 17 of file ByteStreamCnvSvcBase.h.

Constructor & Destructor Documentation

◆ ByteStreamCnvSvcBase()

ByteStreamCnvSvcBase::ByteStreamCnvSvcBase ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

Standard Service Constructor.

Definition at line 16 of file ByteStreamCnvSvcBase.cxx.

17  : base_class(name, pSvcLocator, ByteStreamAddress::storageType()) {}

◆ ~ByteStreamCnvSvcBase()

ByteStreamCnvSvcBase::~ByteStreamCnvSvcBase ( )
virtualdefault

Destructor.

Standard Destructor.

Member Function Documentation

◆ handle()

void ByteStreamCnvSvcBase::handle ( const Incident &  )
overridevirtual

Implementation of IIncidentListener: Handle for EndEvent incidence.

Definition at line 42 of file ByteStreamCnvSvcBase.cxx.

42  {
43  ServiceHandle<IClassIDSvc> clidSvc("ClassIDSvc", name());
44  if (!clidSvc.retrieve().isSuccess()) {
45  ATH_MSG_ERROR("Cannot get ClassIDSvc.");
46  return;
47  }
48  // Initialize the converters
49  for (const std::string& cnv : m_initCnvs.value()) {
50  ATH_MSG_DEBUG("Accessing Converter for " << cnv);
51  CLID id;
52  if (!clidSvc->getIDOfTypeName(cnv, id).isSuccess()) {
53  ATH_MSG_WARNING("Cannot get CLID for " << cnv);
54  } else {
55  IConverter* cnv = converter(id);
56  if (cnv == nullptr) {
57  ATH_MSG_WARNING("Cannot get converter for " << cnv);
58  }
59  }
60  }
61 }

◆ initialize()

StatusCode ByteStreamCnvSvcBase::initialize ( )
overridevirtual

Required of all Gaudi Services.

Initialize the service.

Definition at line 23 of file ByteStreamCnvSvcBase.cxx.

23  {
25 
26  ServiceHandle<IIncidentSvc> incsvc("IncidentSvc", this->name());
27  ATH_CHECK(incsvc.retrieve());
28  incsvc->addListener(this, "BeginRun", 0, false, true); // true for singleshot
29  return StatusCode::SUCCESS;
30 }

◆ updateServiceState()

StatusCode ByteStreamCnvSvcBase::updateServiceState ( IOpaqueAddress *  pAddress)
overridevirtual

Checks whether an IOpaqueAddress is a GenericAddress.

Definition at line 32 of file ByteStreamCnvSvcBase.cxx.

32  {
33  if (pAddress != nullptr) {
34  GenericAddress* pAddr = dynamic_cast<GenericAddress*>(pAddress);
35  if (pAddr != nullptr) {
36  return StatusCode::SUCCESS;
37  }
38  }
39  return StatusCode::FAILURE;
40 }

Member Data Documentation

◆ m_initCnvs

Gaudi::Property<std::vector<std::string> > ByteStreamCnvSvcBase::m_initCnvs {this, "InitCnvs", {}, "Converters to initialize"}
protected

Definition at line 34 of file ByteStreamCnvSvcBase.h.

◆ m_isCalibration

Gaudi::Property<bool> ByteStreamCnvSvcBase::m_isCalibration {this, "IsCalibration", false}
private

flags for Calibration EventType

Definition at line 49 of file ByteStreamCnvSvcBase.h.

◆ m_isSimulation

Gaudi::Property<bool> ByteStreamCnvSvcBase::m_isSimulation {this, "IsSimulation", false}
private

flags for Simulation EventType

Definition at line 45 of file ByteStreamCnvSvcBase.h.

◆ m_isTestbeam

Gaudi::Property<bool> ByteStreamCnvSvcBase::m_isTestbeam {this, "IsTestbeam", false}
private

flags for TestBeam EventType

Definition at line 47 of file ByteStreamCnvSvcBase.h.

◆ m_ROD2ROBmap

Gaudi::Property<std::vector<std::string> > ByteStreamCnvSvcBase::m_ROD2ROBmap {this, "ROD2ROBmap", {}, "", "OrderedSet<std::string>"}
protected

Definition at line 36 of file ByteStreamCnvSvcBase.h.


The documentation for this class was generated from the following files:
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
CLID
uint32_t CLID
The Class ID type.
Definition: Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
ByteStreamAddress::storageType
static constexpr long storageType()
Definition: ByteStreamAddress.h:51
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:239
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
AthCnvSvc::initialize
virtual StatusCode initialize() override
Gaudi Service Implementation.
Definition: AthCnvSvc.cxx:104
ByteStreamCnvSvcBase::m_initCnvs
Gaudi::Property< std::vector< std::string > > m_initCnvs
Definition: ByteStreamCnvSvcBase.h:34
ServiceHandle< IClassIDSvc >