The Gaudi Framework  master (82fdf313)
Loading...
Searching...
No Matches
TemplatedAlg.cpp
Go to the documentation of this file.
1/***********************************************************************************\
2* (c) Copyright 1998-2023 CERN for the benefit of the LHCb and ATLAS collaborations *
3* *
4* This software is distributed under the terms of the Apache version 2 licence, *
5* copied verbatim in the file "LICENSE". *
6* *
7* In applying this licence, CERN does not waive the privileges and immunities *
8* granted to it by virtue of its status as an Intergovernmental Organization *
9* or submit itself to any jurisdiction. *
10\***********************************************************************************/
11
12#include <Gaudi/Algorithm.h>
13#include <string>
14#include <vector>
15
21template <typename T, typename R>
23public:
25
27 return Algorithm::initialize().andThen( [&]() {
28 using Gaudi::PluginService::Details::demangle;
29 info() << "Initializing TemplatedAlg instance " << name() << " of type " << demangle( typeid( *this ) ) << endmsg;
30 } );
31 }
32 StatusCode execute( const EventContext& ) const override { return StatusCode::SUCCESS; }
33
34private:
35 Gaudi::Property<T> m_t{ this, "TProperty", {} };
36 Gaudi::Property<R> m_r{ this, "RProperty", {} };
37};
38
39// Static Factory declaration
42
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition MsgStream.h:198
#define DECLARE_COMPONENT_WITH_ID(type, id)
#define DECLARE_COMPONENT(type)
TemplatedAlg< int, std::vector< std::string > > t1
TemplatedAlg< double, bool > t2
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
This class represents an entry point to all the event specific data.
Base class from which all concrete algorithm classes should be derived.
Definition Algorithm.h:87
Algorithm(std::string name, ISvcLocator *svcloc, std::string version=PACKAGE_VERSION)
Constructor.
Definition Algorithm.h:98
StatusCode initialize() override
the default (empty) implementation of IStateful::initialize() method
Definition Algorithm.h:175
const std::string & name() const override
The identifying name of the algorithm object.
Implementation of property with value of concrete type.
Definition PropertyFwd.h:27
This class is used for returning status codes from appropriate routines.
Definition StatusCode.h:64
StatusCode andThen(F &&f, ARGS &&... args) const
Chain code blocks making the execution conditional a success result.
Definition StatusCode.h:163
constexpr static const auto SUCCESS
Definition StatusCode.h:99
Gaudi::Property< std::vector< std::string > > m_r
StatusCode execute(const EventContext &) const override
StatusCode initialize() override