diff --git a/Control/AthenaExamples/AthExHive/share/DataLoopTest.py b/Control/AthenaExamples/AthExHive/share/DataLoopTest.py index 0f02b262b7de828b74f73ff62379c7cbd04508f1..c6d2af245e9f616b206847e643aa71a87e6c4d5f 100644 --- a/Control/AthenaExamples/AthExHive/share/DataLoopTest.py +++ b/Control/AthenaExamples/AthExHive/share/DataLoopTest.py @@ -84,7 +84,7 @@ HE = HiveAlgE("AlgE",OutputLevel=DEBUG,Time=10) # add a data loop in a sequence to test strict ordering from AthenaCommon.AlgSequence import AthSequencer -alp = AthSequencer("LoopSeq", OutputLevel=DEBUG) +alp = AthSequencer("LoopSeq", OutputLevel=DEBUG, Sequential=True) loopKey = "l2" HL1 = HiveAlgL1("AlgL1",OutputLevel=DEBUG,Key_W1=loopKey,Time=110) diff --git a/Control/AthenaExamples/AthExHive/src/AlgA.cxx b/Control/AthenaExamples/AthExHive/src/AlgA.cxx index dab727d2c1de1fa6aefaaf10f147e8239bbbff82..2d502ee6f05b1eacbe18ead00ac99ee9a75a8718 100644 --- a/Control/AthenaExamples/AthExHive/src/AlgA.cxx +++ b/Control/AthenaExamples/AthExHive/src/AlgA.cxx @@ -3,7 +3,6 @@ */ #include "AlgA.h" -#include "CxxUtils/make_unique.h" #include "EventInfo/EventInfo.h" #include "EventInfo/EventID.h" #include "StoreGate/ReadHandle.h" @@ -14,6 +13,7 @@ #include <thread> #include <chrono> #include <ctime> +#include <memory> AlgA::AlgA( const std::string& name, ISvcLocator* pSvcLocator ) : @@ -64,7 +64,7 @@ StatusCode AlgA::execute() { SG::WriteHandle<HiveDataObj> wh1(m_wrh1); - ATH_CHECK( wh1.record( CxxUtils::make_unique<HiveDataObj> + ATH_CHECK( wh1.record( std::make_unique<HiveDataObj> ( HiveDataObj(10000 + evt->event_ID()->event_number()*100 + m_i) ) ) @@ -73,7 +73,7 @@ StatusCode AlgA::execute() { SG::WriteHandle<HiveDataObj> wh2(m_wrh2); - ATH_CHECK( wh2.record( CxxUtils::make_unique< HiveDataObj >( HiveDataObj(10050+m_i) ) ) ); + ATH_CHECK( wh2.record( std::make_unique< HiveDataObj >( HiveDataObj(10050+m_i) ) ) ); ATH_MSG_INFO(" write: " << wh2.key() << " = " << wh2->val() ); m_i += 1; diff --git a/Control/AthenaExamples/AthExHive/src/AlgB.cxx b/Control/AthenaExamples/AthExHive/src/AlgB.cxx index d3247a0997c8be024f932bb6e6a7d702dc432d29..8049a018a116f1adac3f07cacf55fb7cf47557bc 100644 --- a/Control/AthenaExamples/AthExHive/src/AlgB.cxx +++ b/Control/AthenaExamples/AthExHive/src/AlgB.cxx @@ -3,12 +3,12 @@ */ #include "AlgB.h" -#include "CxxUtils/make_unique.h" #include "StoreGate/ReadHandle.h" #include "StoreGate/WriteHandle.h" #include "GaudiKernel/ServiceHandle.h" #include <thread> #include <chrono> +#include <memory> AlgB::AlgB( const std::string& name, ISvcLocator* pSvcLocator ) : @@ -50,7 +50,7 @@ StatusCode AlgB::execute() { ATH_MSG_INFO(" read: " << rh1.key() << " = " << rh1->val() ); SG::WriteHandle<HiveDataObj> wh1(m_wrh1); - ATH_CHECK( wh1.record( CxxUtils::make_unique< HiveDataObj > + ATH_CHECK( wh1.record( std::make_unique< HiveDataObj > ( HiveDataObj(3300 + rh1->val()) ) ) ); ATH_MSG_INFO(" write: " << wh1.key() << " = " << wh1->val() ); diff --git a/Control/AthenaExamples/AthExHive/src/AlgC.cxx b/Control/AthenaExamples/AthExHive/src/AlgC.cxx index e72e0a1b3d1b460c0c5cf7b1b84b554cdb2e5799..239d679cacf26646e3db91169ca8eee88abee5d9 100644 --- a/Control/AthenaExamples/AthExHive/src/AlgC.cxx +++ b/Control/AthenaExamples/AthExHive/src/AlgC.cxx @@ -4,7 +4,6 @@ #include "AlgC.h" -#include "CxxUtils/make_unique.h" #include "StoreGate/ReadCondHandleKey.h" #include "EventInfo/EventInfo.h" #include "EventInfo/EventID.h" @@ -12,6 +11,7 @@ #include "GaudiKernel/ServiceHandle.h" #include <thread> #include <chrono> +#include <memory> AlgC::AlgC( const std::string& name, diff --git a/Control/AthenaExamples/AthExHive/src/AlgD.cxx b/Control/AthenaExamples/AthExHive/src/AlgD.cxx index 9a04377f64b550d4f3c3f09877d85d5391c6a5d0..6c6e8743bda7e1a40849f4844c99dc4915aa4b00 100644 --- a/Control/AthenaExamples/AthExHive/src/AlgD.cxx +++ b/Control/AthenaExamples/AthExHive/src/AlgD.cxx @@ -3,7 +3,6 @@ */ #include "AlgD.h" -#include "CxxUtils/make_unique.h" #include "StoreGate/ReadHandle.h" #include "StoreGate/ReadCondHandle.h" #include "EventInfo/EventInfo.h" @@ -12,6 +11,7 @@ #include "GaudiKernel/ServiceHandle.h" #include <thread> #include <chrono> +#include <memory> AlgD::AlgD( const std::string& name, diff --git a/Control/AthenaExamples/AthExHive/src/AlgT.cxx b/Control/AthenaExamples/AthExHive/src/AlgT.cxx new file mode 100644 index 0000000000000000000000000000000000000000..d6025982cae7706a76c65404c0926deaa632bf5b --- /dev/null +++ b/Control/AthenaExamples/AthExHive/src/AlgT.cxx @@ -0,0 +1,114 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "AlgT.h" +#include "EventInfo/EventInfo.h" +#include "EventInfo/EventID.h" +#include "StoreGate/ReadHandle.h" +#include "StoreGate/WriteHandle.h" + +#include "GaudiKernel/ServiceHandle.h" + +#include <thread> +#include <chrono> +#include <ctime> +#include <memory> + +AlgT::AlgT( const std::string& name, + ISvcLocator* pSvcLocator ) : + ::AthAlgorithm( name, pSvcLocator ), + m_wrh1("t1"), + m_evt("McEventInfo"), + m_tool1("HiveTool",this), + m_tool2("HiveTool",this), + m_tool3("HiveTool",this) +{ + + declareProperty("Key_W1",m_wrh1); + declareProperty("EvtInfo", m_evt); + + declareProperty("Tool1",m_tool1); + declareProperty("Tool2",m_tool2); + declareProperty("Tool3",m_tool3); + +} + +//--------------------------------------------------------------------------- + +AlgT::~AlgT() {} + +StatusCode AlgT::initialize() { + ATH_MSG_DEBUG("initialize " << name()); + + ATH_CHECK( m_wrh1.initialize() ); + ATH_CHECK( m_evt.initialize() ); + + if ( m_tool1.retrieve().isFailure() ) { + ATH_MSG_FATAL + (m_tool1.propertyName() << ": Failed to retrieve tool " + << m_tool1.type()); + return StatusCode::FAILURE; + } else { + ATH_MSG_INFO("retreived " << m_tool1.name()); + } + + if ( m_tool2.retrieve().isFailure() ) { + ATH_MSG_FATAL + (m_tool2.propertyName() << ": Failed to retrieve tool " + << m_tool2.type()); + return StatusCode::FAILURE; + }else { + ATH_MSG_INFO("retreived " << m_tool2.name()); + } + + + if ( m_tool3.retrieve().isFailure() ) { + ATH_MSG_FATAL + (m_tool3.propertyName() << ": Failed to retrieve tool " + << m_tool3.type()); + return StatusCode::FAILURE; + }else { + ATH_MSG_INFO("retreived " << m_tool3.name()); + } + + + + return StatusCode::SUCCESS; +} + +//--------------------------------------------------------------------------- + +StatusCode AlgT::finalize() { + ATH_MSG_DEBUG("finalize " << name()); + return StatusCode::SUCCESS; +} + +//--------------------------------------------------------------------------- + +StatusCode AlgT::execute() { + + ATH_MSG_DEBUG("execute " << name()); + + SG::ReadHandle<EventInfo> evt(m_evt); + ATH_MSG_INFO(" EventInfo: r: " << evt->event_ID()->run_number() + << " e: " << evt->event_ID()->event_number() ); + + + SG::WriteHandle<HiveDataObj> wh1(m_wrh1); + ATH_CHECK( wh1.record( std::make_unique<HiveDataObj> + ( HiveDataObj(10000 + + evt->event_ID()->event_number()) ) ) + ); + ATH_MSG_INFO(" write: " << wh1.key() << " = " << wh1->val() ); + + + m_tool1->saySomething(); + m_tool2->saySomething(); + m_tool3->saySomething(); + + + return StatusCode::SUCCESS; + +} + diff --git a/Control/AthenaExamples/AthExHive/src/AlgT.h b/Control/AthenaExamples/AthExHive/src/AlgT.h new file mode 100644 index 0000000000000000000000000000000000000000..fcb843c93e96836911414ab879ec5c445562f96f --- /dev/null +++ b/Control/AthenaExamples/AthExHive/src/AlgT.h @@ -0,0 +1,40 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef CONDALGS_ALGT_H +#define CONDALGS_ALGT_H 1 + +#include "AthenaBaseComps/AthAlgorithm.h" +#include "StoreGate/WriteHandleKey.h" +#include "StoreGate/ReadHandleKey.h" +#include "AthExHive/HiveDataObj.h" +#include "AthExHive/IHiveTool.h" + +#include "EventInfo/EventInfo.h" + +#include "GaudiKernel/ToolHandle.h" + +#include <string> + +class AlgT : public AthAlgorithm { + +public: + + AlgT (const std::string& name, ISvcLocator* pSvcLocator); + ~AlgT (); + + StatusCode initialize(); + StatusCode execute(); + StatusCode finalize(); + +private: + + SG::WriteHandleKey<HiveDataObj> m_wrh1; + SG::ReadHandleKey<EventInfo> m_evt; + + + ToolHandle<IHiveTool> m_tool1, m_tool2, m_tool3; + +}; +#endif diff --git a/Control/AthenaExamples/AthExHive/src/CondAlgX.cxx b/Control/AthenaExamples/AthExHive/src/CondAlgX.cxx index d2029902e4ea926f054e52aeba1b0d2724c8b139..d0353b248e03115ef5ff21e07e1f1b9634999206 100644 --- a/Control/AthenaExamples/AthExHive/src/CondAlgX.cxx +++ b/Control/AthenaExamples/AthExHive/src/CondAlgX.cxx @@ -4,7 +4,6 @@ #include "CondAlgX.h" #include "AthExHive/IASCIICondDbSvc.h" -#include "CxxUtils/make_unique.h" #include "StoreGate/WriteCondHandle.h" @@ -18,6 +17,7 @@ #include <thread> #include <chrono> +#include <memory> CondAlgX::CondAlgX( const std::string& name, ISvcLocator* pSvcLocator ) : diff --git a/Control/AthenaExamples/AthExHive/src/CondAlgY.cxx b/Control/AthenaExamples/AthExHive/src/CondAlgY.cxx index 107dded97fa191fd29269241e453cb03e88a644e..f4ce295159eac8990ba33d1d1eea4d6e64dc8a5c 100644 --- a/Control/AthenaExamples/AthExHive/src/CondAlgY.cxx +++ b/Control/AthenaExamples/AthExHive/src/CondAlgY.cxx @@ -4,7 +4,6 @@ #include "CondAlgY.h" #include "AthExHive/IASCIICondDbSvc.h" -#include "CxxUtils/make_unique.h" #include "StoreGate/WriteCondHandle.h" #include "GaudiKernel/ServiceHandle.h" @@ -14,6 +13,7 @@ #include <thread> #include <chrono> +#include <memory> CondAlgY::CondAlgY( const std::string& name, ISvcLocator* pSvcLocator ) : diff --git a/Control/AthenaExamples/AthExHive/src/HiveAlgA.cxx b/Control/AthenaExamples/AthExHive/src/HiveAlgA.cxx index 2b6c18ecb8dc4c914fbb9510ee862b9ecd4b046e..9abae8471666b512924be03a9e511d76ce9d20ba 100644 --- a/Control/AthenaExamples/AthExHive/src/HiveAlgA.cxx +++ b/Control/AthenaExamples/AthExHive/src/HiveAlgA.cxx @@ -3,7 +3,6 @@ */ #include "HiveAlgA.h" -#include "CxxUtils/make_unique.h" #include "GaudiKernel/ServiceHandle.h" #include "EventInfo/EventInfo.h" #include "EventInfo/EventID.h" @@ -11,6 +10,7 @@ #include <thread> #include <chrono> #include <ctime> +#include <memory> HiveAlgA::HiveAlgA( const std::string& name, ISvcLocator* pSvcLocator ) : @@ -61,11 +61,11 @@ StatusCode HiveAlgA::execute() { sleep(); SG::WriteHandle<HiveDataObj> wrh1( m_wrh1 ); - wrh1 = CxxUtils::make_unique< HiveDataObj > + wrh1 = std::make_unique< HiveDataObj > ( HiveDataObj(10000 + evt->event_ID()->event_number()*100 + m_i) ); SG::WriteHandle<HiveDataObj> wrh2( m_wrh2 ); - wrh2 = CxxUtils::make_unique< HiveDataObj >( HiveDataObj(10050+m_i) ); + wrh2 = std::make_unique< HiveDataObj >( HiveDataObj(10050+m_i) ); ATH_MSG_INFO(" write: " << wrh1.key() << " = " << wrh1->val() ); ATH_MSG_INFO(" write: " << wrh2.key() << " = " << wrh2->val() ); diff --git a/Control/AthenaExamples/AthExHive/src/HiveAlgB.cxx b/Control/AthenaExamples/AthExHive/src/HiveAlgB.cxx index 3e7e3599a95e048bcce257d22461353f97290f1f..71fdc1f02401d18e8a534188a64ed82a3d1c97bd 100644 --- a/Control/AthenaExamples/AthExHive/src/HiveAlgB.cxx +++ b/Control/AthenaExamples/AthExHive/src/HiveAlgB.cxx @@ -3,9 +3,9 @@ */ #include "HiveAlgB.h" -#include "CxxUtils/make_unique.h" #include <thread> #include <chrono> +#include <memory> HiveAlgB::HiveAlgB( const std::string& name, ISvcLocator* pSvcLocator ) : @@ -62,7 +62,7 @@ StatusCode HiveAlgB::execute() { m_di = s; SG::WriteHandle<HiveDataObj> wrh1( m_wrh1 ); - wrh1 = CxxUtils::make_unique< HiveDataObj >( HiveDataObj(20000) ); + wrh1 = std::make_unique< HiveDataObj >( HiveDataObj(20000) ); ATH_MSG_INFO(" write: " << wrh1.key() << " = " << wrh1->val() ); return StatusCode::SUCCESS; diff --git a/Control/AthenaExamples/AthExHive/src/HiveAlgBase.cxx b/Control/AthenaExamples/AthExHive/src/HiveAlgBase.cxx index 219c0c5c929f514c36e2e22ec4d7bdf9e72da54a..d194ea7d0756736791dfcbf0e522edbcde5b8353 100644 --- a/Control/AthenaExamples/AthExHive/src/HiveAlgBase.cxx +++ b/Control/AthenaExamples/AthExHive/src/HiveAlgBase.cxx @@ -4,10 +4,9 @@ #include "HiveAlgBase.h" -#include "CxxUtils/make_unique.h" #include <thread> #include <chrono> - +#include <memory> HiveAlgBase::HiveAlgBase( const std::string& name, diff --git a/Control/AthenaExamples/AthExHive/src/HiveAlgC.cxx b/Control/AthenaExamples/AthExHive/src/HiveAlgC.cxx index 31052394a4f78a55814278f8fc4b466af5c1189b..8ca2cc1da1bb3a62bc1d5338d29a58f33fe4ec1a 100644 --- a/Control/AthenaExamples/AthExHive/src/HiveAlgC.cxx +++ b/Control/AthenaExamples/AthExHive/src/HiveAlgC.cxx @@ -3,10 +3,10 @@ */ #include "HiveAlgC.h" -#include "CxxUtils/make_unique.h" #include "GaudiKernel/ServiceHandle.h" #include <thread> #include <chrono> +#include <memory> HiveAlgC::HiveAlgC( const std::string& name, ISvcLocator* pSvcLocator ) : @@ -54,10 +54,10 @@ StatusCode HiveAlgC::execute() { ATH_MSG_INFO(" read: " << rdh1.key() << " = " << rdh1->val() ); SG::WriteHandle<HiveDataObj> wrh1( m_wrh1 ); - wrh1 = CxxUtils::make_unique< HiveDataObj >( HiveDataObj(30000) ); + wrh1 = std::make_unique< HiveDataObj >( HiveDataObj(30000) ); SG::WriteHandle<HiveDataObj> wrh2( m_wrh2 ); - wrh2 = CxxUtils::make_unique< HiveDataObj >( HiveDataObj(30001) ); + wrh2 = std::make_unique< HiveDataObj >( HiveDataObj(30001) ); ATH_MSG_INFO(" write: " << wrh1.key() << " = " << wrh1->val() ); ATH_MSG_INFO(" write: " << wrh2.key() << " = " << wrh2->val() ); diff --git a/Control/AthenaExamples/AthExHive/src/HiveAlgD.cxx b/Control/AthenaExamples/AthExHive/src/HiveAlgD.cxx index 2915dc65396f492701aa5658ec878429cef5fb1a..6322514f0e1e1d9940426a15a20c5a78b4d85989 100644 --- a/Control/AthenaExamples/AthExHive/src/HiveAlgD.cxx +++ b/Control/AthenaExamples/AthExHive/src/HiveAlgD.cxx @@ -3,9 +3,9 @@ */ #include "HiveAlgD.h" -#include "CxxUtils/make_unique.h" #include <thread> #include <chrono> +#include <memory> HiveAlgD::HiveAlgD( const std::string& name, ISvcLocator* pSvcLocator ) : @@ -50,7 +50,7 @@ StatusCode HiveAlgD::execute() { ATH_MSG_INFO(" read: " << rdh1.key() << " = " << rdh1->val() ); SG::WriteHandle<HiveDataObj> wrh1( m_wrh1 ); - wrh1 = CxxUtils::make_unique< HiveDataObj >( HiveDataObj(40000) ); + wrh1 = std::make_unique< HiveDataObj >( HiveDataObj(40000) ); ATH_MSG_INFO(" write: " << wrh1.key() << " = " << wrh1->val() ); return StatusCode::SUCCESS; diff --git a/Control/AthenaExamples/AthExHive/src/HiveAlgE.cxx b/Control/AthenaExamples/AthExHive/src/HiveAlgE.cxx index 3f17ca2508ab3d785b38f8e96061425a48517b0b..d36bf928667ba6ba28fc6c68e207d2f336d35edf 100644 --- a/Control/AthenaExamples/AthExHive/src/HiveAlgE.cxx +++ b/Control/AthenaExamples/AthExHive/src/HiveAlgE.cxx @@ -3,9 +3,9 @@ */ #include "HiveAlgE.h" -#include "CxxUtils/make_unique.h" #include <thread> #include <chrono> +#include <memory> HiveAlgE::HiveAlgE( const std::string& name, ISvcLocator* pSvcLocator ) : @@ -60,7 +60,7 @@ StatusCode HiveAlgE::execute() { ATH_MSG_INFO(" read: " << rdh2.key() << " = " << rdh2->val() ); SG::WriteHandle<HiveDataObj> wrh1( m_wrh1 ); - wrh1 = CxxUtils::make_unique< HiveDataObj >( HiveDataObj(50000) ); + wrh1 = std::make_unique< HiveDataObj >( HiveDataObj(50000) ); ATH_MSG_INFO(" write: " << wrh1.key() << " = " << wrh1->val() ); diff --git a/Control/AthenaExamples/AthExHive/src/HiveAlgF.cxx b/Control/AthenaExamples/AthExHive/src/HiveAlgF.cxx index 99ed9aac3a79d0cb40ed62303a7577bd1ff58e9e..063a6835808a1aa8e080b79b3de9757fb94c629f 100644 --- a/Control/AthenaExamples/AthExHive/src/HiveAlgF.cxx +++ b/Control/AthenaExamples/AthExHive/src/HiveAlgF.cxx @@ -3,9 +3,9 @@ */ #include "HiveAlgF.h" -#include "CxxUtils/make_unique.h" #include <thread> #include <chrono> +#include <memory> HiveAlgF::HiveAlgF( const std::string& name, ISvcLocator* pSvcLocator ) : diff --git a/Control/AthenaExamples/AthExHive/src/HiveAlgG.cxx b/Control/AthenaExamples/AthExHive/src/HiveAlgG.cxx index 975b9b67bb21b6770abc70849e2e184224dd0097..4c308768a1ef7e08a68558d9826ef7082b20ab23 100644 --- a/Control/AthenaExamples/AthExHive/src/HiveAlgG.cxx +++ b/Control/AthenaExamples/AthExHive/src/HiveAlgG.cxx @@ -3,9 +3,9 @@ */ #include "HiveAlgG.h" -#include "CxxUtils/make_unique.h" #include <thread> #include <chrono> +#include <memory> HiveAlgG::HiveAlgG( const std::string& name, ISvcLocator* pSvcLocator ) : @@ -50,7 +50,7 @@ StatusCode HiveAlgG::execute() { ATH_MSG_INFO(" read: " << rdh1.key() << " = " << rdh1->val() ); SG::WriteHandle<HiveDataObj> wrh1( m_wrh1 ); - wrh1 = CxxUtils::make_unique< HiveDataObj >( HiveDataObj(70000) ); + wrh1 = std::make_unique< HiveDataObj >( HiveDataObj(70000) ); ATH_MSG_INFO(" write: " << wrh1.key() << " = " << wrh1->val() ); return StatusCode::SUCCESS; diff --git a/Control/AthenaExamples/AthExHive/src/HiveAlgL1.cxx b/Control/AthenaExamples/AthExHive/src/HiveAlgL1.cxx index 9030d8e8a06180f72d96afa72d8108ec1466179b..ba0165a9411b336f79bfefa117d7c37a473d412c 100644 --- a/Control/AthenaExamples/AthExHive/src/HiveAlgL1.cxx +++ b/Control/AthenaExamples/AthExHive/src/HiveAlgL1.cxx @@ -3,10 +3,10 @@ */ #include "HiveAlgL1.h" -#include "CxxUtils/make_unique.h" #include "GaudiKernel/ServiceHandle.h" #include <thread> #include <chrono> +#include <memory> HiveAlgL1::HiveAlgL1( const std::string& name, ISvcLocator* pSvcLocator ) : @@ -55,7 +55,7 @@ StatusCode HiveAlgL1::execute() { ATH_MSG_INFO(" read: " << rdh1.key() << " = " << rdh1->val() ); SG::WriteHandle<HiveDataObj> wrh1( m_wrh1 ); - wrh1 = CxxUtils::make_unique< HiveDataObj >( HiveDataObj(rdh1->val()+1) ); + wrh1 = std::make_unique< HiveDataObj >( HiveDataObj(rdh1->val()+1) ); ATH_MSG_INFO(" write: " << wrh1.key() << " = " << wrh1->val() ); diff --git a/Control/AthenaExamples/AthExHive/src/HiveAlgL2.cxx b/Control/AthenaExamples/AthExHive/src/HiveAlgL2.cxx index c91e073c496cc232489f818ec0e4976f9a143ac0..b790c6165cb6a78e27dc85f2d253d93dc8991d88 100644 --- a/Control/AthenaExamples/AthExHive/src/HiveAlgL2.cxx +++ b/Control/AthenaExamples/AthExHive/src/HiveAlgL2.cxx @@ -3,10 +3,10 @@ */ #include "HiveAlgL2.h" -#include "CxxUtils/make_unique.h" #include "GaudiKernel/ServiceHandle.h" #include <thread> #include <chrono> +#include <memory> HiveAlgL2::HiveAlgL2( const std::string& name, ISvcLocator* pSvcLocator ) : @@ -54,7 +54,7 @@ StatusCode HiveAlgL2::execute() { udh1->val( udh1->val() + 1); - // wrh1 = CxxUtils::make_unique< HiveDataObj >( HiveDataObj(rdh1->val()+1) ); + // wrh1 = std::make_unique< HiveDataObj >( HiveDataObj(rdh1->val()+1) ); ATH_MSG_INFO(" update: " << udh1.key() << " = " << udh1->val() ); diff --git a/Control/AthenaExamples/AthExHive/src/HiveAlgL3.cxx b/Control/AthenaExamples/AthExHive/src/HiveAlgL3.cxx index f84005f40fda9912ec22a884292fe5a946aa4774..9fce65e9a022b6cc50a720ce406b4e3f0475fdd6 100644 --- a/Control/AthenaExamples/AthExHive/src/HiveAlgL3.cxx +++ b/Control/AthenaExamples/AthExHive/src/HiveAlgL3.cxx @@ -3,10 +3,10 @@ */ #include "HiveAlgL3.h" -#include "CxxUtils/make_unique.h" #include "GaudiKernel/ServiceHandle.h" #include <thread> #include <chrono> +#include <memory> HiveAlgL3::HiveAlgL3( const std::string& name, ISvcLocator* pSvcLocator ) : diff --git a/Control/AthenaExamples/AthExHive/src/HiveAlgM.cxx b/Control/AthenaExamples/AthExHive/src/HiveAlgM.cxx index 2a08c2056af26b6f6696f8fd006162291d185e11..15efbdc8c20e350777c13245557a4ff15458b8c0 100644 --- a/Control/AthenaExamples/AthExHive/src/HiveAlgM.cxx +++ b/Control/AthenaExamples/AthExHive/src/HiveAlgM.cxx @@ -3,9 +3,9 @@ */ #include "HiveAlgM.h" -#include "CxxUtils/make_unique.h" #include <thread> #include <chrono> +#include <memory> HiveAlgM::HiveAlgM( const std::string& name, ISvcLocator* pSvcLocator ) : diff --git a/Control/AthenaExamples/AthExHive/src/HiveAlgR.cxx b/Control/AthenaExamples/AthExHive/src/HiveAlgR.cxx index 2d58a3a24012a0c3f1ee6e303c8951a0bffb8a4a..eab367f6dcef5d95a3be4842d084e03bcca2164d 100644 --- a/Control/AthenaExamples/AthExHive/src/HiveAlgR.cxx +++ b/Control/AthenaExamples/AthExHive/src/HiveAlgR.cxx @@ -5,7 +5,6 @@ #ifdef REENTRANT_GAUDI #include "HiveAlgR.h" -#include "CxxUtils/make_unique.h" #include "GaudiKernel/ServiceHandle.h" #include "EventInfo/EventInfo.h" #include "EventInfo/EventID.h" @@ -13,6 +12,7 @@ #include <thread> #include <chrono> #include <ctime> +#include <memory> DECLARE_COMPONENT(HiveAlgR) @@ -56,7 +56,7 @@ StatusCode HiveAlgR::execute_r(const EventContext& ctx) const { SG::WriteHandle<HiveDataObj> wh1(m_wrh1); - ATH_CHECK( wh1.record( CxxUtils::make_unique<HiveDataObj> + ATH_CHECK( wh1.record( std::make_unique<HiveDataObj> ( HiveDataObj(10000 + evt->event_ID()->event_number()*100 ))) ); diff --git a/Control/AthenaExamples/AthExHive/src/HiveAlgV.cxx b/Control/AthenaExamples/AthExHive/src/HiveAlgV.cxx index 30ec5a6251c4aadaaf556ac4f4c9c2f5db689b01..90a34baadd5c5ce5bde0728c2b265613ea5fd93d 100644 --- a/Control/AthenaExamples/AthExHive/src/HiveAlgV.cxx +++ b/Control/AthenaExamples/AthExHive/src/HiveAlgV.cxx @@ -3,10 +3,10 @@ */ #include "HiveAlgV.h" -#include "CxxUtils/make_unique.h" #include <thread> #include <chrono> #include <vector> +#include <memory> HiveAlgV::HiveAlgV( const std::string& name, ISvcLocator* pSvcLocator ) : @@ -76,7 +76,7 @@ void HiveAlgV::write() { std::vector< SG::WriteHandle<HiveDataObj> > whv = m_whv.makeHandles(); for (auto &hnd : whv) { - hnd = CxxUtils::make_unique<HiveDataObj> ( HiveDataObj( 10101 ) ); + hnd = std::make_unique<HiveDataObj> ( HiveDataObj( 10101 ) ); ATH_MSG_INFO(" write: " << hnd.key() << " = " << hnd->val() ); } } diff --git a/Control/AthenaExamples/AthExHive/src/HiveTool.cxx b/Control/AthenaExamples/AthExHive/src/HiveTool.cxx index e0f4fe6dcbc09c8b929587c8fefaa7b0fd77966e..92764f2375eda2cf4377f859640201dc49165e5c 100644 --- a/Control/AthenaExamples/AthExHive/src/HiveTool.cxx +++ b/Control/AthenaExamples/AthExHive/src/HiveTool.cxx @@ -6,7 +6,9 @@ #include "GaudiKernel/SvcFactory.h" #include "StoreGate/ReadHandle.h" +#include "StoreGate/WriteHandle.h" +#include <memory> /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ //DECLARE_TOOL_FACTORY(HiveTool) @@ -14,13 +16,16 @@ HiveTool::HiveTool(const std::string& type, const std::string& name, const IInterface* parent) - : base_class( type, name, parent ), - m_rdh1("b1") +// : base_class( type, name, parent ), + : AthAlgTool(type,name,parent), + m_rdh1("x1"), + m_wrh1("X1") { declareProperty("MyMessage", m_myMessage, "the default message"); declareProperty("Key_R1",m_rdh1); + declareProperty("Key_W1",m_wrh1); } @@ -33,7 +38,21 @@ StatusCode HiveTool::initialize() { ATH_MSG_INFO("initialize"); + if (m_rdh1.key() != "") { ATH_CHECK( m_rdh1.initialize() ); + ATH_MSG_INFO("read key: " << m_rdh1.key()); + } else { + ATH_MSG_INFO("RH key is blank. not initializing"); + } + + if (m_wrh1.key() != "") { + ATH_CHECK( m_wrh1.initialize() ); + ATH_MSG_INFO("write key: " << m_wrh1.key()); + } else { + ATH_MSG_INFO("WH key is blank. not initializing"); + } + + return StatusCode::SUCCESS; } @@ -48,14 +67,25 @@ HiveTool::finalize() { StatusCode HiveTool::saySomething() const { ATH_MSG_INFO ("message: " << m_myMessage); + int val = 0; + + if (m_rdh1.key() == "") { + ATH_MSG_INFO("RH not valid - not retrieving"); + } else { SG::ReadHandle<HiveDataObj> rh( m_rdh1 ); + ATH_MSG_INFO(" read: " << rh.key() << " = " << rh->val() ); + val = rh->val(); + } + + if (m_wrh1.key() == "") { + ATH_MSG_INFO("WH not valid - not writing"); + } else { + SG::WriteHandle<HiveDataObj> wrh1( m_wrh1 ); + wrh1 = std::make_unique< HiveDataObj > + ( HiveDataObj(val + 666) ); + ATH_MSG_INFO(" write: " << wrh1.key() << " = " << wrh1->val() ); + } - // if (!m_rdh1.isValid()) { - // ATH_MSG_ERROR ("Could not retrieve HiveDataObj with key " << m_rdh1.key()); - // return StatusCode::FAILURE; - // } - - ATH_MSG_INFO(" read: " << rh.key() << " = " << rh->val() ); return StatusCode::SUCCESS; } diff --git a/Control/AthenaExamples/AthExHive/src/HiveTool.h b/Control/AthenaExamples/AthExHive/src/HiveTool.h index 92ba7c3e02a7fee0f8ba66b13560caab702d80da..cb85acdd9cee88d9fb04190ea16df30b1cdafe3c 100644 --- a/Control/AthenaExamples/AthExHive/src/HiveTool.h +++ b/Control/AthenaExamples/AthExHive/src/HiveTool.h @@ -8,11 +8,13 @@ #include "AthenaBaseComps/AthAlgTool.h" #include "AthExHive/IHiveTool.h" #include "StoreGate/ReadHandleKey.h" +#include "StoreGate/WriteHandleKey.h" #include "AthExHive/HiveDataObj.h" #include <string> -class HiveTool : public extends1<AthAlgTool,IHiveTool> { +//class HiveTool : public extends1<AthAlgTool,IHiveTool> { +class HiveTool : virtual public AthAlgTool, virtual public IHiveTool { public: HiveTool( const std::string&, const std::string&, const IInterface* ); virtual ~HiveTool(); @@ -29,6 +31,7 @@ private: std::string m_myMessage; SG::ReadHandleKey<HiveDataObj> m_rdh1; + SG::WriteHandleKey<HiveDataObj> m_wrh1; }; diff --git a/Control/AthenaExamples/AthExHive/src/components/AthExHive_entries.cxx b/Control/AthenaExamples/AthExHive/src/components/AthExHive_entries.cxx index bd15e338c6f7e82980df70507ea3fa05d8879dc3..880d740554f83d968c89bcac9b8848cd51aa8a6d 100644 --- a/Control/AthenaExamples/AthExHive/src/components/AthExHive_entries.cxx +++ b/Control/AthenaExamples/AthExHive/src/components/AthExHive_entries.cxx @@ -22,6 +22,7 @@ #include "../AlgB.h" #include "../AlgC.h" #include "../AlgD.h" +#include "../AlgT.h" #include "../CondAlgX.h" #include "../CondAlgY.h" @@ -50,6 +51,7 @@ DECLARE_ALGORITHM_FACTORY( AlgA ) DECLARE_ALGORITHM_FACTORY( AlgB ) DECLARE_ALGORITHM_FACTORY( AlgC ) DECLARE_ALGORITHM_FACTORY( AlgD ) +DECLARE_ALGORITHM_FACTORY( AlgT ) DECLARE_ALGORITHM_FACTORY( CondAlgX ) DECLARE_ALGORITHM_FACTORY( CondAlgY )