Skip to content

Commit

Permalink
Add an example producer
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcarcell committed Jul 9, 2023
1 parent 72f6cbc commit fa8d27c
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions k4ProjectTemplate/src/components/ExampleProducer.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#include "Gaudi/Property.h"
#include "GaudiAlg/GaudiAlgorithm.h"
#include "GaudiAlg/Producer.h"

#include <string>

using BaseClass_t = Gaudi::Functional::Traits::BaseClass_t<Gaudi::Algorithm>;

struct ExampleProducer final : Gaudi::Functional::Producer<int(), BaseClass_t> {

ExampleProducer( const std::string& name, ISvcLocator* svcLoc )
: Producer( name, svcLoc, KeyValue( "OutputLocation", m_outputLocation ) ) {}

int operator()() const override {
return m_exampleInt;
}

Gaudi::Property<std::string> m_outputLocation{this, "OutputLocation", "/ExampleInt"};
Gaudi::Property<int> m_exampleInt{this, "ExampleInt", 3};

};

DECLARE_COMPONENT(ExampleProducer)

0 comments on commit fa8d27c

Please sign in to comment.