From e05a9637c9ea96751328d263d9b02fd236e6cf37 Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Fri, 17 Jul 2020 12:02:51 -0400
Subject: [PATCH] OutputStreamAthenaPool: Add IAthenaOutputTool::preStream()

Add abstract method IAthenaOutputTool::preStream().
To be called just before streaming objects.
---
 .../src/MakeEventStreamInfo.cxx                  |  9 +++++----
 .../src/MakeEventStreamInfo.h                    | 16 +++++++++-------
 2 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/Database/AthenaPOOL/OutputStreamAthenaPool/src/MakeEventStreamInfo.cxx b/Database/AthenaPOOL/OutputStreamAthenaPool/src/MakeEventStreamInfo.cxx
index 8b49f3e3ae1..65699cc71c6 100644
--- a/Database/AthenaPOOL/OutputStreamAthenaPool/src/MakeEventStreamInfo.cxx
+++ b/Database/AthenaPOOL/OutputStreamAthenaPool/src/MakeEventStreamInfo.cxx
@@ -23,13 +23,10 @@
 //___________________________________________________________________________
 MakeEventStreamInfo::MakeEventStreamInfo(const std::string& type,
 	const std::string& name,
-	const IInterface* parent) : ::AthAlgTool(type, name, parent),
+	const IInterface* parent) : base_class(type, name, parent),
 		m_metaDataSvc("MetaDataSvc", name),
                 m_eventStore("StoreGateSvc", name)
 {
-   // Declare IAthenaOutputStreamTool interface
-   declareInterface<IAthenaOutputTool>(this);
-
    // Declare the properties
    declareProperty("Key", m_key = "");
    declareProperty("EventInfoKey", m_eventInfoKey = "EventInfo");
@@ -68,6 +65,10 @@ StatusCode MakeEventStreamInfo::preExecute() {
    return(StatusCode::SUCCESS);
 }
 //___________________________________________________________________________
+StatusCode MakeEventStreamInfo::preStream() {
+   return(StatusCode::SUCCESS);
+}
+//___________________________________________________________________________
 StatusCode MakeEventStreamInfo::postExecute() {
    const IAlgorithm* parentAlg = dynamic_cast<const IAlgorithm*>(this->parent());
    if (parentAlg == nullptr) {
diff --git a/Database/AthenaPOOL/OutputStreamAthenaPool/src/MakeEventStreamInfo.h b/Database/AthenaPOOL/OutputStreamAthenaPool/src/MakeEventStreamInfo.h
index d8dda11f4ae..fb4ffcef6a5 100644
--- a/Database/AthenaPOOL/OutputStreamAthenaPool/src/MakeEventStreamInfo.h
+++ b/Database/AthenaPOOL/OutputStreamAthenaPool/src/MakeEventStreamInfo.h
@@ -24,7 +24,7 @@ namespace xAODMaker {  class IEventInfoCnvTool;  }
 /** @class MakeEventStreamInfo 
  *  @brief This class provides an algorithm to make the EventStreamInfo object and update it.
  **/
-class MakeEventStreamInfo : public ::AthAlgTool, virtual public IAthenaOutputTool {
+class MakeEventStreamInfo : public extends<::AthAlgTool, IAthenaOutputTool> {
 public:
    /// Standard AlgTool Constructor
    MakeEventStreamInfo(const std::string& type, const std::string& name, const IInterface* parent);
@@ -32,17 +32,19 @@ public:
    virtual ~MakeEventStreamInfo();
    /// Required of all IAthenaOutputTools:
    /// Called by AthenaOutputStream::initialize() (via ToolSvc retrieve()).
-   StatusCode initialize();
+   virtual StatusCode initialize() override;
    /// Called at the end of AthenaOutputStream::initialize().
-   StatusCode postInitialize();
+   virtual StatusCode postInitialize() override;
    /// Called at the beginning of AthenaOutputStream::execute().
-   StatusCode preExecute();
+   virtual StatusCode preExecute() override;
+   /// Called before actually streaming objects.
+   virtual StatusCode preStream() override;
    /// Called at the end of AthenaOutputStream::execute().
-   StatusCode postExecute();
+   virtual StatusCode postExecute() override;
    /// Called at the beginning of AthenaOutputStream::finalize().
-   StatusCode preFinalize();
+   virtual StatusCode preFinalize() override;
    /// Called at the end of AthenaOutputStream::finalize() (via release()).
-   StatusCode finalize();
+   virtual StatusCode finalize() override;
 
 private:
    /// Key, the StoreGate key for the EventStreamInfo object.
-- 
GitLab