Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 09:41:48

0001 // This file is part of the ACTS project.
0002 //
0003 // Copyright (C) 2016 CERN for the benefit of the ACTS project
0004 //
0005 // This Source Code Form is subject to the terms of the Mozilla Public
0006 // License, v. 2.0. If a copy of the MPL was not distributed with this
0007 // file, You can obtain one at https://mozilla.org/MPL/2.0/.
0008 
0009 #pragma once
0010 
0011 #include "ActsExamples/Framework/AlgorithmContext.hpp"
0012 #include "ActsExamples/Framework/ProcessCode.hpp"
0013 
0014 #include <string>
0015 #include <vector>
0016 
0017 namespace ActsExamples {
0018 
0019 class DataHandleBase;
0020 struct AlgorithmContext;
0021 
0022 /// Event processing interface.
0023 ///
0024 class SequenceElement {
0025  public:
0026   virtual ~SequenceElement() = default;
0027 
0028   /// The sequence element name.
0029   virtual std::string name() const = 0;
0030 
0031   /// The sequence element type name, used for debug output
0032   virtual std::string_view typeName() const = 0;
0033 
0034   /// Initialize the algorithm
0035   virtual ProcessCode initialize() = 0;
0036 
0037   /// Finalize the algorithm
0038   virtual ProcessCode finalize() = 0;
0039 
0040   /// Internal method to execute the algorithm for one event.
0041   /// @note Usually, you should not override this method
0042   virtual ProcessCode internalExecute(const AlgorithmContext& context) = 0;
0043 
0044   const std::vector<const DataHandleBase*>& writeHandles() const;
0045   const std::vector<const DataHandleBase*>& readHandles() const;
0046 
0047  private:
0048   void registerWriteHandle(const DataHandleBase& handle);
0049   void registerReadHandle(const DataHandleBase& handle);
0050 
0051   friend class DataHandleBase;
0052 
0053   friend class BufferedReader;
0054 
0055   std::vector<const DataHandleBase*> m_writeHandles;
0056   std::vector<const DataHandleBase*> m_readHandles;
0057 };
0058 
0059 }  // namespace ActsExamples