Move signals to event triggers

Move the generation and initialization of signals to be included in the
available event triggers. The signal trigger consists of subscribing to
a given signal match where when the signal is received and handled, it
causes the event actions to be called.

Tested:
    All current event signals are still registered and received
    Speed changes occur based on temperature sensor change signals

Change-Id: Iab4ccabb50ad910d5d566bd8c1922109638bd760
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
diff --git a/control/templates/defs.mako b/control/templates/defs.mako
index 89e01ca..6308774 100644
--- a/control/templates/defs.mako
+++ b/control/templates/defs.mako
@@ -64,12 +64,12 @@
     make_trigger(trigger::timer(TimerConf{
     ${event['triggers']['timer']['interval']},
     ${event['triggers']['timer']['type']}
-    }))
+    })),
     %endif
-},
-std::vector<Signal>{
-%for s in event['triggers']['signals']:
-    Signal{
+    %if ('signals' in event['triggers']) and \
+        (event['triggers']['signals'] is not None):
+    %for s in event['triggers']['signals']:
+    make_trigger(trigger::signal(
         %if ('match' in s) and \
             (s['match'] is not None):
         match::${s['match']}(
@@ -87,7 +87,8 @@
         make_handler(\
         ${indent(genHandler(sig=s), 3)}\
         )
-    },
-%endfor
-}
+    )),
+    %endfor
+    %endif
+},
 </%def>\
diff --git a/control/templates/fan_zone_defs.mako.cpp b/control/templates/fan_zone_defs.mako.cpp
index c049516..eb30762 100644
--- a/control/templates/fan_zone_defs.mako.cpp
+++ b/control/templates/fan_zone_defs.mako.cpp
@@ -162,12 +162,12 @@
                             make_trigger(trigger::timer(TimerConf{
                             ${event['pc']['triggers']['pctime']['interval']},
                             ${event['pc']['triggers']['pctime']['type']}
-                        }))
+                            })),
                             %endif
-                        },
-                        std::vector<Signal>{
-                        %for s in event['pc']['triggers']['pcsigs']:
-                            Signal{
+                            %if ('pcsigs' in event['pc']['triggers']) and \
+                                (event['pc']['triggers']['pcsigs'] is not None):
+                            %for s in event['pc']['triggers']['pcsigs']:
+                            make_trigger(trigger::signal(
                                 %if ('match' in s) and \
                                     (s['match'] is not None):
                                 match::${s['match']}(
@@ -185,9 +185,10 @@
                                 make_handler(\
                                 ${indent(genHandler(sig=s), 9)}\
                                 )
-                            },
-                        %endfor
-                        }
+                            )),
+                            %endfor
+                            %endif
+                        },
                     %endif
                     },
                 %endfor