ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/grimes/L1Menu/interface/l1menu/TriggerTable.h
Revision: 1.2
Committed: Wed May 15 10:41:35 2013 UTC (11 years, 11 months ago) by grimes
Content type: text/plain
Branch: MAIN
Changes since 1.1: +2 -0 lines
Log Message:
Got everything pretty much working for a scram build

File Contents

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