File indexing completed on 2026-09-14 08:37:52
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011 #include "Acts/Utilities/Logger.hpp"
0012 #include "ActsExamples/Framework/ProcessCode.hpp"
0013 #include "ActsExamples/Framework/SequenceElement.hpp"
0014
0015 #include <memory>
0016 #include <string>
0017
0018 namespace ActsExamples {
0019
0020
0021
0022
0023
0024
0025 class IAlgorithm : public SequenceElement {
0026 public:
0027
0028
0029
0030
0031
0032 [[deprecated("Use the constructor with a logger instead")]]
0033 explicit IAlgorithm(const std::string& name, Acts::Logging::Level level);
0034
0035
0036
0037
0038
0039 explicit IAlgorithm(const std::string& name,
0040 std::unique_ptr<const Acts::Logger> logger = nullptr);
0041
0042
0043 std::string name() const override;
0044
0045
0046
0047
0048 virtual ProcessCode execute(const AlgorithmContext& context) const = 0;
0049
0050
0051
0052 ProcessCode internalExecute(const AlgorithmContext& context) final;
0053
0054
0055 ProcessCode initialize() override { return ProcessCode::SUCCESS; }
0056
0057 ProcessCode finalize() override { return ProcessCode::SUCCESS; }
0058
0059 std::string_view typeName() const override { return "Algorithm"; }
0060
0061 protected:
0062 const Acts::Logger& logger() const { return *m_logger; }
0063
0064 private:
0065 std::string m_name;
0066 std::unique_ptr<const Acts::Logger> m_logger;
0067 };
0068
0069 }