ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/grimes/L1Menu/interface/l1menu/TriggerTable.h
Revision: 1.1
Committed: Sun May 5 20:37:27 2013 UTC (12 years ago) by grimes
Content type: text/plain
Branch: MAIN
Log Message:
First draft of the L1 Trigger rate estimation code

File Contents

# User Rev Content
1 grimes 1.1 #ifndef l1menu_TriggerTable_h
2     #define l1menu_TriggerTable_h
3    
4     #include <memory>
5    
6     // Forward declarations
7     namespace l1menu
8     {
9     class ITrigger;
10     }
11    
12     namespace l1menu
13     {
14     class TriggerTable
15     {
16     public:
17     struct TriggerDetails
18     {
19     std::string name;
20     unsigned int version;
21     bool operator==( const TriggerDetails& otherTriggerDetails ) const;
22     };
23     public:
24     /** @brief Get the latest version of the trigger with the supplied name. */
25     std::auto_ptr<l1menu::ITrigger> getTrigger( const std::string& name ) const;
26    
27     /** @brief Get a specific version of the trigger with the supplied name. */
28     std::auto_ptr<l1menu::ITrigger> getTrigger( const std::string& name, unsigned int version ) const;
29     std::auto_ptr<l1menu::ITrigger> getTrigger( const TriggerDetails& details ) const;
30    
31     std::auto_ptr<l1menu::ITrigger> copyTrigger( const l1menu::ITrigger& triggerToCopy ) const;
32    
33     /** @brief List the triggers available.
34     *
35     * Returns a vector of pairs, where first is the trigger name and second is the trigger version.
36     */
37     std::vector<TriggerDetails> listTriggers() const;
38    
39     static void registerTrigger( const std::string name, unsigned int version, std::auto_ptr<l1menu::ITrigger> (*creationFunctionPointer)() );
40     private:
41     struct TriggerRegistryEntry
42     {
43     TriggerDetails details;
44     std::auto_ptr<l1menu::ITrigger> (*creationFunctionPointer)();
45     };
46     static std::vector<TriggerRegistryEntry> registeredTriggers;
47     };
48    
49     }
50     #endif