LDMX Software
PluginFactory.h
Go to the documentation of this file.
1
8#ifndef FRAMEWORK_EVENTPROCESSORFACTORY_H_
9#define FRAMEWORK_EVENTPROCESSORFACTORY_H_
10
11// LDMX
14
15// STL
16#include <map>
17#include <set>
18#include <vector>
19
20namespace framework {
21
27 public:
33
40 void registerEventProcessor(const std::string& classname, int classtype,
41 EventProcessorMaker* maker);
42
51 void registerConditionsObjectProvider(const std::string& classname,
52 int classtype,
54
59 std::vector<std::string> getEventProcessorClasses() const;
60
65 int getEventProcessorClasstype(const std::string&) const;
66
73 EventProcessor* createEventProcessor(const std::string& classname,
74 const std::string& moduleInstanceName,
75 Process& process);
76
85 const std::string& classname, const std::string& objName,
86 const std::string& tagname, const framework::config::Parameters& params,
87 Process& process);
88
93 void loadLibrary(const std::string& libname);
94
95 private:
100
105 struct PluginInfo {
106 std::string classname;
107 int classtype;
108 EventProcessorMaker* ep_maker;
110 };
111
113 std::map<std::string, PluginInfo> moduleInfo_;
114
116 std::set<std::string> librariesLoaded_;
117
120};
121
122} // namespace framework
123
124#endif
Base class for provider of conditions information like pedestals, gains, electronics maps,...
Base classes for all user event processing components to extend.
Base class for all providers of conditions objects.
Base class for all event processing components.
Singleton module factory that creates EventProcessor objects.
void registerConditionsObjectProvider(const std::string &classname, int classtype, ConditionsObjectProviderMaker *maker)
Register a conditions object provider.
ConditionsObjectProvider * createConditionsObjectProvider(const std::string &classname, const std::string &objName, const std::string &tagname, const framework::config::Parameters &params, Process &process)
Make a conditions object provider.
static PluginFactory theFactory_
Factory for creating the plugin objects.
int getEventProcessorClasstype(const std::string &) const
Get the class type for the event processor.
std::vector< std::string > getEventProcessorClasses() const
Get the classes associated with the processor.
std::map< std::string, PluginInfo > moduleInfo_
A map of names to processor containers.
EventProcessor * createEventProcessor(const std::string &classname, const std::string &moduleInstanceName, Process &process)
Make an event processor.
std::set< std::string > librariesLoaded_
A set of names of loaded libraries.
void loadLibrary(const std::string &libname)
Load a library.
void registerEventProcessor(const std::string &classname, int classtype, EventProcessorMaker *maker)
Register the event processor.
static PluginFactory & getInstance()
Get the factory instance.
Class which represents the process under execution.
Definition Process.h:36
Class encapsulating parameters for configuring a processor.
Definition Parameters.h:27
All classes in the ldmx-sw project use this namespace.
Definition PerfDict.cxx:45
EventProcessor * EventProcessorMaker(const std::string &name, Process &process)
Typedef for EventProcessorFactory use.
ConditionsObjectProvider * ConditionsObjectProviderMaker(const std::string &objname, const std::string &tagname, const framework::config::Parameters &params, Process &process)
Typedef for PluginFactory use.
info container to hold classname, class type and maker.