2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
5 #ifndef ATHENABASECOMPS_ATHCHECKEDCOMPONENT_ICC
6 #define ATHENABASECOMPS_ATHCHECKEDCOMPONENT_ICC
8 #include "Gaudi/Interfaces/IOptionsSvc.h"
9 #include "GaudiKernel/ISvcLocator.h"
11 template <class PBASE>
12 StatusCode AthCheckedComponent<PBASE>::sysInitialize()
14 ATH_CHECK( PBASE::sysInitialize() );
15 ATH_CHECK( isConfigured() );
16 return StatusCode::SUCCESS;
19 template <class PBASE>
20 StatusCode AthCheckedComponent<PBASE>::isConfigured()
22 Gaudi::Interfaces::IOptionsSvc& joSvc = this->serviceLocator()->getOptsSvc();
24 // Check that at least one of my properties has been set:
25 for (const auto prop : this->getProperties()) {
26 if (joSvc.isSet(this->name() + "." + prop->name())) return StatusCode::SUCCESS;
29 ATH_MSG_ERROR("No job properties found. This is not allowed for an AthCheckedComponent.");
30 return StatusCode::FAILURE;