/usr/include/Rivet/AnalysisBuilder.hh is in librivet-dev 1.8.3-1.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | // -*- C++ -*-
#ifndef RIVET_AnalysisBuilder_HH
#define RIVET_AnalysisBuilder_HH
#include "Rivet/Rivet.hh"
#include "Rivet/Analysis.fhh"
#include "Rivet/AnalysisLoader.hh"
#include "Rivet/Tools/Logging.fhh"
namespace Rivet {
/// @cond ANALYSIS_PLUGIN_DETAILS
/// @brief Interface for analysis builders
class AnalysisBuilderBase {
public:
AnalysisBuilderBase() { }
virtual ~AnalysisBuilderBase() { }
virtual Analysis* mkAnalysis() const = 0;
const string name() const {
Analysis* a = mkAnalysis();
string rtn = a->name();
delete a;
return rtn;
}
protected:
void _register() {
AnalysisLoader::_registerBuilder(this);
}
};
/// @brief Self-registering analysis plugin builder
template <typename T>
class AnalysisBuilder : public AnalysisBuilderBase {
public:
AnalysisBuilder() {
_register();
}
Analysis* mkAnalysis() const {
return new T();
}
};
/// @endcond
}
#endif
|